summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/arithm/tarithm.nim39
-rw-r--r--tests/async/tasync_traceback.nim9
-rw-r--r--tests/misc/tsemfold.nim2
-rw-r--r--tests/vm/toverflowopcmulint.nim2
4 files changed, 15 insertions, 37 deletions
diff --git a/tests/arithm/tarithm.nim b/tests/arithm/tarithm.nim
index f27174aef..1150af951 100644
--- a/tests/arithm/tarithm.nim
+++ b/tests/arithm/tarithm.nim
@@ -29,6 +29,7 @@ block tcast:
     let rt = ty(exp)
     const ct = ty(exp)
     if $rt != $ct:
+      echo astToStr(exp)
       echo "Got ", ct
       echo "Expected ", rt
 
@@ -52,7 +53,7 @@ block tcast:
   crossCheck(uint8, uint8.high + 5'u8)
   crossCheck(uint16, uint16.high + 5'u16)
   crossCheck(uint32, uint32.high + 5'u32)
-  crossCheck(uint64, (-1).uint64 + 5'u64)
+  crossCheck(uint64, 0xFFFFFFFFFFFFFFFF'u64 + 5'u64)
 
   doAssert $sub1(0'u8) == "255"
   doAssert $sub1(0'u16) == "65535"
@@ -69,12 +70,10 @@ block tcast:
   crossCheck(int64, high(int8).int16.int32.int64)
   crossCheck(int64, low(int8).int16.int32.int64)
 
-  crossCheck(int64, 0xFFFFFFFFFFFFFFFF'u64)
-  crossCheck(int32, 0xFFFFFFFFFFFFFFFF'u64)
-  crossCheck(int16, 0xFFFFFFFFFFFFFFFF'u64)
-  crossCheck(int8 , 0xFFFFFFFFFFFFFFFF'u64)
-
-
+  doAssert not compiles(echo int64(0xFFFFFFFFFFFFFFFF'u64))
+  doAssert not compiles(echo int32(0xFFFFFFFFFFFFFFFF'u64))
+  doAssert not compiles(echo int16(0xFFFFFFFFFFFFFFFF'u64))
+  doAssert not compiles(echo  int8(0xFFFFFFFFFFFFFFFF'u64))
 
 block tnot:
   # Signed types
@@ -116,32 +115,6 @@ block tnot:
     doAssert t7 == 4
 
 
-
-block tshl:
-  # Signed types
-  block:
-    const t0: int8  = 1'i8 shl 8
-    const t1: int16 = 1'i16 shl 16
-    const t2: int32 = 1'i32 shl 32
-    const t3: int64 = 1'i64 shl 64
-    doAssert t0 == 0
-    doAssert t1 == 0
-    doAssert t2 == 1
-    doAssert t3 == 1
-
-  # Unsigned types
-  block:
-    const t0: uint8  = 1'u8 shl 8
-    const t1: uint16 = 1'u16 shl 16
-    const t2: uint32 = 1'u32 shl 32
-    const t3: uint64 = 1'u64 shl 64
-    doAssert t0 == 0
-    doAssert t1 == 0
-    doAssert t2 == 0
-    doAssert t3 == 1
-
-
-
 block tshr:
   proc T() =
     # let VI = -8
diff --git a/tests/async/tasync_traceback.nim b/tests/async/tasync_traceback.nim
index ac1e2fd8c..7cfbd563f 100644
--- a/tests/async/tasync_traceback.nim
+++ b/tests/async/tasync_traceback.nim
@@ -122,8 +122,13 @@ let expLines = splitLines(expected.strip)
 
 if resLines.len != expLines.len:
   echo("Not matched! Wrong number of lines!")
-  echo()
-  echo(result)
+  echo expLines.len
+  echo resLines.len
+  echo("Expected: -----------")
+  echo expected
+  echo("Gotten: -------------")
+  echo result
+  echo("---------------------")
   quit(QuitFailure)
 
 var ok = true
diff --git a/tests/misc/tsemfold.nim b/tests/misc/tsemfold.nim
index 2101a8b50..486ddc5a6 100644
--- a/tests/misc/tsemfold.nim
+++ b/tests/misc/tsemfold.nim
@@ -24,4 +24,4 @@ doAssertRaises(OverflowError): discard high(int64) * 2
 
 doAssert abs(-1) == 1
 doAssert 2 div 2 == 1
-doAssert 2 * 3 == 6
\ No newline at end of file
+doAssert 2 * 3 == 6
diff --git a/tests/vm/toverflowopcmulint.nim b/tests/vm/toverflowopcmulint.nim
index 81b3234ba..5607c59a7 100644
--- a/tests/vm/toverflowopcmulint.nim
+++ b/tests/vm/toverflowopcmulint.nim
@@ -5,7 +5,7 @@ discard """
 static:
   proc p =
     var
-      x = 1 shl 62
+      x = 1'i64 shl 62
     discard x * 2
     assert false
   p()