From 51f37ea7a8a1c249be80499b181ca529c02c7c4c Mon Sep 17 00:00:00 2001 From: Josquin Cornec Date: Tue, 26 Mar 2024 15:57:25 +0100 Subject: [PATCH] add siren header as first line of filter_siren.csv (#105) Co-authored-by: Josquin Cornec --- createfilter/main.go | 1 + createfilter/main_test.go | 2 +- createfilter/test_golden.txt | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/createfilter/main.go b/createfilter/main.go index b85d5aa..cf36d31 100644 --- a/createfilter/main.go +++ b/createfilter/main.go @@ -73,6 +73,7 @@ func CreateFilter(writer io.Writer, effectifFileName string, nbMois, minEffectif perimeter = applyFilter(perimeter, f) } + fmt.Fprintln(writer, "siren") for siren, _ := range perimeter { fmt.Fprintln(writer, siren) } diff --git a/createfilter/main_test.go b/createfilter/main_test.go index 1cf313b..74e443b 100644 --- a/createfilter/main_test.go +++ b/createfilter/main_test.go @@ -34,7 +34,7 @@ func TestCreateFilter(t *testing.T) { expectedOutput := DiffWithGoldenFile(outGoldenFile, *updateGoldenFile, cmdOutput) expectedError := DiffWithGoldenFile(errGoldenFile, *updateGoldenFile, cmdError) - assert.Equal(t, string(expectedOutput), sortOutput(cmdOutput.String())) + assert.Equal(t, string(expectedOutput), cmdOutput.String()) assert.Equal(t, string(expectedError), cmdError.String()) }) } diff --git a/createfilter/test_golden.txt b/createfilter/test_golden.txt index 562d6b2..cf77d58 100644 --- a/createfilter/test_golden.txt +++ b/createfilter/test_golden.txt @@ -1,2 +1,3 @@ +siren 444444444 555555555