diff options
author | Connor Schembor <connor.schembor@rutgers.edu> | 2020-10-29 21:52:05 -0400 |
---|---|---|
committer | Louis Pilfold <louis@lpil.uk> | 2020-10-30 11:46:09 +0100 |
commit | 8e421527ad59a4bcea656ca1cdd6c643c99771c9 (patch) | |
tree | 2a613e75920bdf648eb336b7ba739ebb2984036b /test | |
parent | 6b2b12760686566bf4ca88008f06194788d32eb1 (diff) | |
download | gleam_stdlib-8e421527ad59a4bcea656ca1cdd6c643c99771c9.tar.gz gleam_stdlib-8e421527ad59a4bcea656ca1cdd6c643c99771c9.zip |
Add to_float function for int module
Diffstat (limited to 'test')
-rw-r--r-- | test/gleam/int_test.gleam | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/gleam/int_test.gleam b/test/gleam/int_test.gleam index 4a01073..97fbb84 100644 --- a/test/gleam/int_test.gleam +++ b/test/gleam/int_test.gleam @@ -52,6 +52,20 @@ pub fn to_base_string_test() { |> should.equal("-64") } +pub fn to_float_test() { + int.to_float(1) + |> should.equal(1.) + + int.to_float(5) + |> should.equal(5.) + + int.to_float(0) + |> should.equal(0.) + + int.to_float(-5) + |> should.equal(-5.) +} + pub fn compare_test() { int.compare(0, 0) |> should.equal(order.Eq) |