Merge pull request #100763 from masap/unit_test2

Fix a unit test failure in non English languages
This commit is contained in:
Kubernetes Prow Robot 2021-04-10 20:29:51 -07:00 committed by GitHub
commit 2babe67f47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -54,6 +54,11 @@ func (f *FakeObject) Live() runtime.Object {
func TestDiffProgram(t *testing.T) {
externalDiffCommands := [3]string{"diff", "diff -ruN", "diff --report-identical-files"}
if oriLang := os.Getenv("LANG"); oriLang != "C" {
os.Setenv("LANG", "C")
defer os.Setenv("LANG", oriLang)
}
for i, c := range externalDiffCommands {
os.Setenv("KUBECTL_EXTERNAL_DIFF", c)
streams, _, stdout, _ := genericclioptions.NewTestIOStreams()