go-zookeeper / zk

Native ZooKeeper client for Go
BSD 3-Clause "New" or "Revised" License
504 stars 130 forks source link

add initial assertion library #148

Closed MKrupauskas closed 3 weeks ago

MKrupauskas commented 3 weeks ago

Adds initial test assertion library. Closes #147 and more context in the issue.

This PR just introduces the library to make reviews easier. It will be used in another PR after this.

Unit tested.

$ make unittest
=== RUN   TestEqual
=== RUN   TestEqual/equal
=== RUN   TestEqual/not_equal_shallow
=== RUN   TestEqual/not_equal_deep
=== RUN   TestEqual/with_message
=== RUN   TestEqual/with_message_and_args
=== RUN   TestEqual/only_args
--- PASS: TestEqual (0.00s)
    --- PASS: TestEqual/equal (0.00s)
    --- PASS: TestEqual/not_equal_shallow (0.00s)
    --- PASS: TestEqual/not_equal_deep (0.00s)
    --- PASS: TestEqual/with_message (0.00s)
    --- PASS: TestEqual/with_message_and_args (0.00s)
    --- PASS: TestEqual/only_args (0.00s)
=== RUN   TestNoError
=== RUN   TestNoError/no_error
=== RUN   TestNoError/with_error
=== RUN   TestNoError/with_message
=== RUN   TestNoError/with_message_and_args
=== RUN   TestNoError/only_args
--- PASS: TestNoError (0.00s)
    --- PASS: TestNoError/no_error (0.00s)
    --- PASS: TestNoError/with_error (0.00s)
    --- PASS: TestNoError/with_message (0.00s)
    --- PASS: TestNoError/with_message_and_args (0.00s)
    --- PASS: TestNoError/only_args (0.00s)
PASS
coverage: 100.0% of statements
ok      github.com/go-zookeeper/zk/internal/assert      1.371s  coverage: 100.0% of statements
codecov[bot] commented 3 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 79.71%. Comparing base (27bc0d6) to head (30e5002). Report is 1 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #148 +/- ## ========================================== + Coverage 79.12% 79.71% +0.59% ========================================== Files 8 9 +1 Lines 1365 1385 +20 ========================================== + Hits 1080 1104 +24 + Misses 196 193 -3 + Partials 89 88 -1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.