Skip to content

Commit

Permalink
Add unit tests for math/function.
Browse files Browse the repository at this point in the history
  • Loading branch information
Roberto Reale committed Mar 6, 2018
1 parent 842ce6c commit e451f17
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/math/function.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bats

source bashlet math/function

@test "math/function: roughly estimate a square root" {
result="$(bash$$ function rough_sqrt 50)"
expected=8
[[ $result -eq $expected ]]
}
@test "math/function: calculate a square root" {
result="$(bash$$ function sqrt 64)"
expected=8
[[ $result -eq $expected ]]
}

0 comments on commit e451f17

Please sign in to comment.