summary refs log tree commit diff stats
path: root/tests/system/tlowhigh.nim
diff options
context:
space:
mode:
authormetagn <metagngn@gmail.com>2023-06-06 07:54:07 +0300
committerGitHub <noreply@github.com>2023-06-06 06:54:07 +0200
commitb97d603cd00a210547bda1a2a1c3e09f97fcc49e (patch)
tree080b4ad7b5826b88a9483c6a0e4d697096f12cc1 /tests/system/tlowhigh.nim
parent2ab948ce53e3d9b80bf9b02644c8ec8991f34d0a (diff)
downloadNim-b97d603cd00a210547bda1a2a1c3e09f97fcc49e.tar.gz
some test cleanups & category reorganization (#22010)
* clean up some test categories

* mention exact slice issue

* magics into system

* move trangechecks into overflow

* move tmemory to system

* try fix CI

* try fix CI

* final CI fix
Diffstat (limited to 'tests/system/tlowhigh.nim')
-rw-r--r--tests/system/tlowhigh.nim32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/system/tlowhigh.nim b/tests/system/tlowhigh.nim
new file mode 100644
index 000000000..6ae871255
--- /dev/null
+++ b/tests/system/tlowhigh.nim
@@ -0,0 +1,32 @@
+discard """
+    action: run
+    output: '''
+18446744073709551615
+9223372036854775807
+4294967295
+0
+0
+'''
+"""
+
+var x: range[-1'f32..1'f32]
+doAssert x.low == -1'f32
+doAssert x.high == 1'f32
+doAssert x.type.low == -1'f32
+doAssert x.type.high == 1'f32
+var y: range[-1'f64..1'f64]
+doAssert y.low == -1'f64
+doAssert y.high == 1'f64
+doAssert y.type.low == -1'f64
+doAssert y.type.high == 1'f64
+
+# bug #11972
+var num: uint8
+doAssert num.high.float == 255.0
+
+echo high(uint64)
+echo high(int64)
+echo high(uint32)
+
+echo low(uint64)
+echo low(uint32)