Skip to content

Commit

Permalink
Fixed typo IsProertyMissingInExpandPropsInString -> IsPropertyMissing…
Browse files Browse the repository at this point in the history
…InExpandPropsInString
  • Loading branch information
cmaglie committed Jun 30, 2020
1 parent 108bd3e commit 162f7fb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions properties.go
Original file line number Diff line number Diff line change
Expand Up @@ -405,12 +405,12 @@ func (m *Map) ExpandPropsInString(str string) string {
return m.expandProps(str, false)
}

// IsProertyMissingInExpandPropsInString checks if a property 'prop' is missing
// IsPropertyMissingInExpandPropsInString checks if a property 'prop' is missing
// when the ExpandPropsInString method is applied to the input string 'str'.
// This method returns false if the 'prop' is defined in the map
// or if 'prop' is not used in the string expansion of 'str', otherwise
// the method returns true.
func (m *Map) IsProertyMissingInExpandPropsInString(prop, str string) bool {
func (m *Map) IsPropertyMissingInExpandPropsInString(prop, str string) bool {
if m.ContainsKey(prop) {
return false
}
Expand Down
8 changes: 4 additions & 4 deletions properties_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ func TestExpandPropsInStringAndMissingCheck(t *testing.T) {

require.Equal(t, "42 == 42 == true", aMap.ExpandPropsInString("{key1} == {key2} == true"))

require.False(t, aMap.IsProertyMissingInExpandPropsInString("key3", "{key1} == {key2} == true"))
require.False(t, aMap.IsProertyMissingInExpandPropsInString("key1", "{key1} == {key2} == true"))
require.True(t, aMap.IsProertyMissingInExpandPropsInString("key4", "{key4} == {key2}"))
require.True(t, aMap.IsProertyMissingInExpandPropsInString("key4", "{key3} == {key2}"))
require.False(t, aMap.IsPropertyMissingInExpandPropsInString("key3", "{key1} == {key2} == true"))
require.False(t, aMap.IsPropertyMissingInExpandPropsInString("key1", "{key1} == {key2} == true"))
require.True(t, aMap.IsPropertyMissingInExpandPropsInString("key4", "{key4} == {key2}"))
require.True(t, aMap.IsPropertyMissingInExpandPropsInString("key4", "{key3} == {key2}"))
}

func TestExpandPropsInString2(t *testing.T) {
Expand Down

0 comments on commit 162f7fb

Please sign in to comment.