From bbe4cf4703903081553fe066ece5a57a5f190493 Mon Sep 17 00:00:00 2001 From: Timothee Cour Date: Sat, 27 Mar 2021 12:03:14 -0700 Subject: followup custom literals (#17500) --- tests/lexer/tunary_minus.nim | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'tests/lexer/tunary_minus.nim') diff --git a/tests/lexer/tunary_minus.nim b/tests/lexer/tunary_minus.nim index 639911fcd..87b3cb52d 100644 --- a/tests/lexer/tunary_minus.nim +++ b/tests/lexer/tunary_minus.nim @@ -51,8 +51,17 @@ template main = doAssert x() == minusOne: "unable to handle negatives after semi-colon" + block: doAssert -0b111 == -7 doAssert -0xff == -255 + doAssert -128'i8 == (-128).int8 + doAssert $(-128'i8) == "-128" + doAssert -32768'i16 == int16.low + doAssert -2147483648'i32 == int32.low + when int.sizeof > 4: + doAssert -9223372036854775808 == int.low + when not defined(js): + doAssert -9223372036854775808 == int64.low block: # check when a minus (-) is an unary op doAssert -one == minusOne: @@ -68,6 +77,5 @@ template main = doAssert 4 - one == 3: "unable to handle subtraction with surrounding spaces with an identifier" - static: main() main() -- cgit 1.4.1-2-gfad0 ef='/ahoang/Nim/refs/?h=devel&id=4d56b7da5a9558ac45158b5c614e4aa4e922d864'>refs log tree commit diff stats
path: root/tests/realtimeGC/main.nim.cfg
blob: fed4fa4718858cf108bd7af6df1f83c10a8aed42 (plain) (blame)
1
2
3
4
5
6