mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-07-17 17:52:12 +00:00
Trim trailing spaces and tabs from config map files
This commit is contained in:
@@ -95,3 +95,13 @@ func TestKeyValuesFromFileSources(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestTrimTrailingSpacesInLines(t *testing.T) {
|
||||
kvl := makeKvLoader(filesys.MakeFsInMemory())
|
||||
input := "\"fooKey\": \"fooValue\" \t\n\t\"barKey\": \"barValue\""
|
||||
expected := "\"fooKey\": \"fooValue\"\n\t\"barKey\": \"barValue\""
|
||||
res := kvl.trimTrailingSpacesInLines(input)
|
||||
if !reflect.DeepEqual(res, expected) {
|
||||
t.Errorf("Trim trailing spaces in lines should succeed, got: %s exptected: %s", res, expected)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user