josephburnett / jd

JSON diff and patch
MIT License
826 stars 38 forks source link

Convert array tests to TableDrivenTests #29

Closed wafuwafu13 closed 3 years ago

wafuwafu13 commented 3 years ago

Hi :) I done this TODO . https://github.com/josephburnett/jd/blob/d1d4edfee5375f88c1155ef55158597fb8488751/lib/array_test.go#L7

Ref: https://github.com/golang/go/wiki/TableDrivenTests

Result

~/go/src/jd/lib
$ go test -v -cover
=== RUN   TestArrayJson
--- PASS: TestArrayJson (0.00s)
=== RUN   TestArrayEqual
--- PASS: TestArrayEqual (0.00s)
=== RUN   TestArrayNotEqual
--- PASS: TestArrayNotEqual (0.00s)
=== RUN   TestArrayHash
--- PASS: TestArrayHash (0.00s)
=== RUN   TestArrayDiff
--- PASS: TestArrayDiff (0.00s)
=== RUN   TestArrayPatch
--- PASS: TestArrayPatch (0.00s)
...
...
PASS
coverage: 85.9% of statements
josephburnett commented 3 years ago

That's great! @wafuwafu13 thank you for the contribution!