summary refs log tree commit diff stats
path: root/tests/system
diff options
context:
space:
mode:
authorDaniil Yarancev <21169548+Yardanico@users.noreply.github.com>2018-01-07 21:02:00 +0300
committerGitHub <noreply@github.com>2018-01-07 21:02:00 +0300
commitfb44c522e6173528efa8035ecc459c84887d0167 (patch)
treea2f5e98606be265981a5f72748896967033e23d7 /tests/system
parentccf99fa5ce4fe992fb80dc89271faa51456c3fa5 (diff)
parente23ea64c41e101d4e1d933f0b015f51cc6c2f7de (diff)
downloadNim-fb44c522e6173528efa8035ecc459c84887d0167.tar.gz
Merge pull request #1 from nim-lang/devel
upstream
Diffstat (limited to 'tests/system')
-rw-r--r--tests/system/toString.nim10
-rw-r--r--tests/system/tsystem_misc.nim22
2 files changed, 27 insertions, 5 deletions
diff --git a/tests/system/toString.nim b/tests/system/toString.nim
index 1279897a7..ea9d6b05b 100644
--- a/tests/system/toString.nim
+++ b/tests/system/toString.nim
@@ -3,13 +3,13 @@ discard """
 """
 
 doAssert "@[23, 45]" == $(@[23, 45])
-doAssert  "[32, 45]" == $([32, 45])
-doAssert "@[, foo, bar]" == $(@["", "foo", "bar"])
-doAssert  "[, foo, bar]" ==  $(["", "foo", "bar"])
+doAssert "[32, 45]" == $([32, 45])
+doAssert """@["", "foo", "bar"]""" == $(@["", "foo", "bar"])
+doAssert """["", "foo", "bar"]""" ==  $(["", "foo", "bar"])
 
 # bug #2395
 let alphaSet: set[char] = {'a'..'c'}
-doAssert "{a, b, c}" == $alphaSet
+doAssert "{'a', 'b', 'c'}" == $alphaSet
 doAssert "2.3242" == $(2.3242)
 doAssert "2.982" == $(2.982)
 doAssert "123912.1" == $(123912.1)
@@ -49,5 +49,5 @@ import strutils
 # array test
 
 let arr = ['H','e','l','l','o',' ','W','o','r','l','d','!','\0']
-doAssert $arr == "[H, e, l, l, o,  , W, o, r, l, d, !, \0]"
+doAssert $arr == "['H', 'e', 'l', 'l', 'o', ' ', 'W', 'o', 'r', 'l', 'd', '!', '\\x00']"
 doAssert $cstring(unsafeAddr arr) == "Hello World!"
diff --git a/tests/system/tsystem_misc.nim b/tests/system/tsystem_misc.nim
new file mode 100644
index 000000000..ce36895a1
--- /dev/null
+++ b/tests/system/tsystem_misc.nim
@@ -0,0 +1,22 @@
+discard """
+  output:""
+"""
+
+# check high/low implementations
+doAssert high(int) > low(int)
+doAssert high(int8) > low(int8)
+doAssert high(int16) > low(int16)
+doAssert high(int32) > low(int32)
+doAssert high(int64) > low(int64)
+# doAssert high(uint) > low(uint) # reconsider depending on issue #6620
+doAssert high(uint8) > low(uint8)
+doAssert high(uint16) > low(uint16)
+doAssert high(uint32) > low(uint32)
+# doAssert high(uint64) > low(uint64) # reconsider depending on issue #6620
+doAssert high(float) > low(float)
+doAssert high(float32) > low(float32)
+doAssert high(float64) > low(float64)
+
+# bug #6710
+var s = @[1]
+s.delete(0)