hare

The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit 5656968d451bdd448429e6351afcbf7cc222fb85
parent fe8af8458421bfb0d7a693d29fbc9bcd0a0b0c11
Author: Eyal Sawady <ecs@d2evs.net>
Date:   Mon, 21 Feb 2022 23:57:55 +0000

Update I64_MIN for lexer changes

Signed-off-by: Eyal Sawady <ecs@d2evs.net>

Diffstat:
Mstrconv/+test/stoi.ha | 5+++--
Mtypes/limits.ha | 2+-
2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/strconv/+test/stoi.ha b/strconv/+test/stoi.ha @@ -3,6 +3,7 @@ // (c) 2021 Andri Yngvason <andri@yngvason.is> // (c) 2022 Bor Grošelj Simić <bor.groseljsimic@telemach.net> // (c) 2021 Eyal Sawady <ecs@d2evs.net> +use types; @test fn stoi() void = { assert(stoi64("") as invalid == 0: invalid); @@ -16,8 +17,8 @@ assert(stoi64("1") as i64 == 1); assert(stoi64("+1") as i64 == 1); assert(stoi64("-1") as i64 == -1); - assert(stoi64("9223372036854775807") as i64 == 9223372036854775807); - assert(stoi64("-9223372036854775808") as i64 == -9223372036854775808); + assert(stoi64("9223372036854775807") as i64 == types::I64_MAX); + assert(stoi64("-9223372036854775808") as i64 == types::I64_MIN); assert(stoi32("2147483648") is overflow); assert(stoi32("-2147483649") is overflow); diff --git a/types/limits.ha b/types/limits.ha @@ -21,7 +21,7 @@ export def I32_MIN: i32 = -2147483648; export def I32_MAX: i32 = 2147483647; // Minimum value which can be stored in an i64 type -export def I64_MIN: i64 = -9223372036854775808; +export def I64_MIN: i64 = -9223372036854775808i64; // Maximum value which can be stored in an i64 type. export def I64_MAX: i64 = 9223372036854775807;