my first iteration was my shortcut using ‘group_by’ and I realized that the test succeed if the keys are in order.
(from function `assert_equal' in file bats-extra.bash, line 178,
in test file test-nucleotide-count.bats, line 30)
`assert_equal "$output" "$expected"' failed
-- values do not equal --
expected : {"A":0,"C":0,"G":1,"T":0}
actual : {"G":1,"A":0,"C":0,"T":0}
--
in order to submit the solution, I sort the keys to match the expected value.
In the next iteration, I put reduce with zero / init object whose keys order matches the expected. If I jumbled the keys order, the test failed.
(from function `assert_equal' in file bats-extra.bash, line 178,
in test file test-nucleotide-count.bats, line 16)
`assert_equal "$output" "$expected"' failed
-- values do not equal --
expected : {"A":0,"C":0,"G":0,"T":0}
actual : {"C":0,"A":0,"T":0,"G":0}
IMO this is something wrong and I’m wondering how to fix this.