News for hackers. Stuff that matters.
Re:Unit Tests as Documentation by Etherlord87 on Thursday October 17, 2024 @05:17PM (#41873888)
Documentation:

> returns a sum of reciprocals of inputs

Unit Test:

    assert_eq(foo(2, 5), 1/2 + 1/5)
    assert_eq(foo(4, 7), 1/4 + 1/7)
    assert_eq(foo(10, 100, 10000), 0.1101)

There are no comments on this comment yet.