require errormsg to be specified before file.
This commit is contained in:
parent
ca394ebd95
commit
1105d03644
264 changed files with 305 additions and 623 deletions
|
|
@ -1,6 +1,6 @@
|
|||
discard """
|
||||
file: "strscans.nim"
|
||||
errormsg: "type mismatch between pattern '$i' (position: 1) and HourRange var 'hour'"
|
||||
file: "strscans.nim"
|
||||
"""
|
||||
|
||||
import strscans
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
discard """
|
||||
file: "tbitops.nim"
|
||||
output: "OK"
|
||||
"""
|
||||
import bitops
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
discard """
|
||||
file: "tbitops.nim"
|
||||
output: "OK"
|
||||
"""
|
||||
import bitops
|
||||
|
|
|
|||
|
|
@ -1,9 +1,3 @@
|
|||
discard """
|
||||
action: run
|
||||
file: tcgi.nim
|
||||
output: "[Suite] Test cgi module"
|
||||
"""
|
||||
|
||||
import unittest
|
||||
import cgi, strtabs
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
discard """
|
||||
file: "tjsonmacro.nim"
|
||||
output: ""
|
||||
"""
|
||||
import json, strutils, options, tables
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
discard """
|
||||
errormsg: "Use a named tuple instead of: (string, float)"
|
||||
file: "tjsonmacro_reject.nim"
|
||||
line: 11
|
||||
errormsg: "Use a named tuple instead of: (string, float)"
|
||||
"""
|
||||
|
||||
import json
|
||||
|
|
@ -15,4 +15,4 @@ let j = """
|
|||
{"engine": {"name": "V8", "capacity": 5.5}, model: "Skyline"}
|
||||
"""
|
||||
let parsed = parseJson(j)
|
||||
echo(to(parsed, Car))
|
||||
echo(to(parsed, Car))
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
discard """
|
||||
errormsg: "The `to` macro does not support ref objects with cycles."
|
||||
file: "tjsonmacro_reject2.nim"
|
||||
line: 10
|
||||
errormsg: "The `to` macro does not support ref objects with cycles."
|
||||
"""
|
||||
import json
|
||||
|
||||
|
|
@ -18,4 +18,4 @@ let data = """
|
|||
"""
|
||||
|
||||
let dataParsed = parseJson(data)
|
||||
let dataDeser = to(dataParsed, Cycle)
|
||||
let dataDeser = to(dataParsed, Cycle)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,3 @@
|
|||
discard """
|
||||
file: "tmemfiles1.nim"
|
||||
outputsub: ""
|
||||
"""
|
||||
import memfiles, os
|
||||
var
|
||||
mm: MemFile
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
discard """
|
||||
file: "tmemmapstreams.nim"
|
||||
output: '''Created size: 10
|
||||
output: '''
|
||||
Created size: 10
|
||||
Position after writing: 5
|
||||
Position after writing one char: 6
|
||||
Peeked data: Hello
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
discard """
|
||||
file: "tospaths.nim"
|
||||
output: ""
|
||||
"""
|
||||
# test the ospaths module
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
discard """
|
||||
file: "tospaths.nim"
|
||||
output: ""
|
||||
"""
|
||||
# test the osproc module
|
||||
|
|
|
|||
|
|
@ -1,7 +1,3 @@
|
|||
discard """
|
||||
file: "tparsesql.nim"
|
||||
"""
|
||||
|
||||
import parsesql
|
||||
|
||||
doAssert $parseSQL("SELECT foo FROM table;") == "select foo from table;"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
discard """
|
||||
file: "tregex.nim"
|
||||
output: "key: keyAYes!"
|
||||
"""
|
||||
# Test the new regular expression module
|
||||
|
|
@ -27,5 +26,3 @@ else:
|
|||
echo("Bug!")
|
||||
|
||||
#OUT key: keyAYes!
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
discard """
|
||||
file: "trepr.nim"
|
||||
output: "{a, b}{'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'}"
|
||||
"""
|
||||
|
||||
|
|
@ -26,4 +25,3 @@ when false:
|
|||
# "a", "b", "c", "d", "e"
|
||||
#]
|
||||
#echo(repr(testseq))
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
discard """
|
||||
file: "tstreams2.nim"
|
||||
output: '''fs is: nil'''
|
||||
"""
|
||||
import streams
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
discard """
|
||||
file: "tstreams3.nim"
|
||||
output: "threw exception"
|
||||
"""
|
||||
import streams
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
discard """
|
||||
file: "tstring.nim"
|
||||
output: "OK"
|
||||
"""
|
||||
const characters = "abcdefghijklmnopqrstuvwxyz"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
discard """
|
||||
file: "tstrutil.nim"
|
||||
output: "ha/home/a1xyz/usr/bin"
|
||||
"""
|
||||
# test the new strutils module
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
discard """
|
||||
file: "tsugar.nim"
|
||||
output: ""
|
||||
"""
|
||||
import sugar
|
||||
|
|
|
|||
|
|
@ -1,8 +1,5 @@
|
|||
discard """
|
||||
file: "ttimes.nim"
|
||||
target: "c js"
|
||||
output: '''[Suite] ttimes
|
||||
'''
|
||||
"""
|
||||
|
||||
import times, strutils, unittest
|
||||
|
|
@ -125,7 +122,7 @@ suite "ttimes":
|
|||
when defined(linux) or defined(macosx):
|
||||
let tz_dir = getEnv("TZDIR", "/usr/share/zoneinfo")
|
||||
const f = "yyyy-MM-dd HH:mm zzz"
|
||||
|
||||
|
||||
let orig_tz = getEnv("TZ")
|
||||
var tz_cnt = 0
|
||||
for tz_fn in walkFiles(tz_dir & "/**/*"):
|
||||
|
|
@ -152,7 +149,7 @@ suite "ttimes":
|
|||
check initDateTime(29, mOct, 2017, 01, 00, 00).isDst
|
||||
check initDateTime(29, mOct, 2017, 03, 01, 00).format(f) == "2017-10-29 03:01 +01:00"
|
||||
check (not initDateTime(29, mOct, 2017, 03, 01, 00).isDst)
|
||||
|
||||
|
||||
check initDateTime(21, mOct, 2017, 01, 00, 00).format(f) == "2017-10-21 01:00 +02:00"
|
||||
|
||||
test "issue #6520":
|
||||
|
|
@ -170,10 +167,10 @@ suite "ttimes":
|
|||
check diff == initDuration(seconds = 2208986872)
|
||||
|
||||
test "issue #6465":
|
||||
putEnv("TZ", "Europe/Stockholm")
|
||||
putEnv("TZ", "Europe/Stockholm")
|
||||
let dt = parse("2017-03-25 12:00", "yyyy-MM-dd hh:mm")
|
||||
check $(dt + initTimeInterval(days = 1)) == "2017-03-26T12:00:00+02:00"
|
||||
check $(dt + initDuration(days = 1)) == "2017-03-26T13:00:00+02:00"
|
||||
check $(dt + initDuration(days = 1)) == "2017-03-26T13:00:00+02:00"
|
||||
|
||||
test "datetime before epoch":
|
||||
check $fromUnix(-2147483648).utc == "1901-12-13T20:45:52Z"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue