summaryrefslogtreecommitdiff
path: root/lib/std/test/fmt.myr
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-02-07 23:10:05 -0800
committerOri Bernstein <ori@eigenstate.org>2017-02-07 23:10:05 -0800
commit2edc2786c55409339a666cd0dc41e21099017d24 (patch)
treed8978d14edafb2cd11ede93dc2cdf7c9e368660c /lib/std/test/fmt.myr
parent330fd3f777d230d333c58d609a0eb2330e30d6df (diff)
downloadmc-2edc2786c55409339a666cd0dc41e21099017d24.tar.gz
Format minimum values correctly.
-x == -x; handle that right.
Diffstat (limited to 'lib/std/test/fmt.myr')
-rw-r--r--lib/std/test/fmt.myr6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/std/test/fmt.myr b/lib/std/test/fmt.myr
index a1bf9e6..e8e3f22 100644
--- a/lib/std/test/fmt.myr
+++ b/lib/std/test/fmt.myr
@@ -69,6 +69,12 @@ const builtins = {
check("0.000101323461002", "{}", 0.000101323461002)
check("(1, `Bar 123, `Foo )", "{}", (1, `Bar 123, `Foo))
+ /* tricky cases: min values for integers */
+ check("-128", "{}", (-128 : int8))
+ check("-32768", "{}", (-32768 : int16))
+ check("-2147483648", "{}", (-2147483648 : int32))
+ check("-9223372036854775808", "{}", -9223372036854775808l)
+
/*
compound types, followed by single value to make
sure we consume the right byte count.