Skip to content

Commit

Permalink
test: fix venom random failed (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
Youen Péron authored Oct 30, 2023
1 parent 61c57c2 commit 679499c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.env
bin
.cache
test/suites/*.json
12 changes: 7 additions & 5 deletions test/suites/04-run-anonymizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ testcases:
- name: generalization
steps:
- script: rm -f output_sigo.json
- script: rm -f output_jq.json
- script: rm -f expected.json
- script: |-
cat > expected.json <<EOF
{"fruit":[0,1],"taille":[1,2],"poids":[1,2],"meurtre":0,"natation":[0,1],"course":[0,1],"voltige":[0,1],"animal":"souris"}
Expand All @@ -28,7 +31,7 @@ testcases:
{"fruit":[1,1],"taille":[4,5],"poids":[4,5],"meurtre":0,"natation":[1,1],"course":[1,1],"voltige":[0,0],"animal":"elephant"}
EOF
- script: |-
sigo -q taille,poids,fruit,natation,course,voltige -s meurtre -k 2 -l 2 -a general > output.json <<EOF
sigo -q taille,poids,fruit,natation,course,voltige -s meurtre -k 2 -l 2 -a general > output_sigo.json <<EOF
{"fruit":1, "taille": 2, "poids": 2 , "meurtre": 0, "natation":1, "course":1, "voltige":1 , "animal": "canard"}
{"fruit":1, "taille": 5, "poids": 5 , "meurtre": 0, "natation":1, "course":1, "voltige":0 , "animal": "elephant"}
{"fruit":1, "taille": 4, "poids": 4 , "meurtre": 1, "natation":1, "course":1, "voltige":0 , "animal": "ours"}
Expand All @@ -40,13 +43,12 @@ testcases:
EOF
assertions:
- result.code ShouldEqual 0
- script: cat output.json | jq -c "{fruit:.fruit,taille:.taille,poids:.poids,meurtre:.meurtre,natation:.natation,course:.course,voltige:.voltige,animal:.animal}" > output.json
- script: cat output_sigo.json | jq -c "{fruit:.fruit,taille:.taille,poids:.poids,meurtre:.meurtre,natation:.natation,course:.course,voltige:.voltige,animal:.animal}" > output_jq.json
assertions:
- result.systemerr ShouldBeEmpty
- result.code ShouldEqual 0
- script: diff output.json expected.json
- script: diff output_jq.json expected.json
assertions:
- result.code ShouldEqual 0
- result.systemout ShouldBeEmpty
- script: rm -f output.json
- script: rm -f expected.json

0 comments on commit 679499c

Please sign in to comment.