diff options
Diffstat (limited to 'tests/accept')
-rwxr-xr-x | tests/accept/compile/sunset.tmpl | 68 | ||||
-rwxr-xr-x | tests/accept/compile/tdictdestruct.nim | 10 | ||||
-rwxr-xr-x | tests/accept/compile/tlexer.nim | 9 | ||||
-rwxr-xr-x | tests/accept/compile/treadln.nim | 4 | ||||
-rwxr-xr-x | tests/accept/compile/ttempl.nim | 4 | ||||
-rwxr-xr-x[-rw-r--r--] | tests/accept/run/mmultim3.nim | 0 | ||||
-rwxr-xr-x | tests/accept/run/spec.csv | 15 | ||||
-rwxr-xr-x[-rw-r--r--] | tests/accept/run/tcontinuexc.nim | 0 | ||||
-rwxr-xr-x | tests/accept/run/tfinally.nim | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | tests/accept/run/tfinally2.nim | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | tests/accept/run/tfinally3.nim | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | tests/accept/run/tmultim3.nim | 0 | ||||
-rwxr-xr-x | tests/accept/run/tregex.nim | 18 | ||||
-rwxr-xr-x | tests/accept/run/tvariantasgn.nim | 2 | ||||
-rwxr-xr-x | tests/accept/run/tvariantstack.nim | 2 |
15 files changed, 106 insertions, 28 deletions
diff --git a/tests/accept/compile/sunset.tmpl b/tests/accept/compile/sunset.tmpl new file mode 100755 index 000000000..6475bac4e --- /dev/null +++ b/tests/accept/compile/sunset.tmpl @@ -0,0 +1,68 @@ +#! stdtmpl +#proc sunsetTemplate*(current, ticker, content: string, +# tabs: openarray[array[0..1, string]]): string = +# result = "" +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> + +<head> + <title>Nimrod Programming System</title> + <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> + <link rel="stylesheet" type="text/css" href="style/style.css" /> +</head> + +<body> + <div id="main"> + <div id="links"> + <!-- **** INSERT LINKS HERE **** --> + </div> + <div id="logo"><h1>Nimrod Programming System</h1></div> + <div id="content"> + <div id="menu"> + <ul> + #for item in items(tabs): + #var name = item[0] + #var t = item[1] + #if t == current: + <li><a id="selected" href="${t}.html" title = "Nimrod - $name">$name</a></li> + #else: + <li><a href="${t}.html" title = "Nimrod - $name">$name</a></li> + #end if + #end for + </ul> + </div> + <div id="column1"> + <div class="sidebaritem"> + <div class="sbihead"> + <h1>latest news</h1> + </div> + <div class="sbicontent"> + $ticker + </div> + </div> + <div class="sidebaritem"> + <div class="sbihead"> + <h1>additional links</h1> + </div> + <div class="sbilinks"> + <!-- **** INSERT ADDITIONAL LINKS HERE **** --> + <ul> + <li><a class="reference" href="http://llvm.org">LLVM</a></li> + <li><a class="reference" href="http://gcc.gnu.org">GCC</a></li> + </ul> + </div> + </div> + </div> + <div id="column2"> + $content + </div> + </div> + <div id="footer"> + copyright © 2008 Andreas Rumpf | Last update: ${getDateStr()} + | <a class="reference" href="http://validator.w3.org/check?uri=referer">XHTML 1.1</a> + | <a class="reference" href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a> + | <a class="reference" href="http://www.dcarter.co.uk">design by dcarter</a> + </div> + </div> +</body> +</html> diff --git a/tests/accept/compile/tdictdestruct.nim b/tests/accept/compile/tdictdestruct.nim index 20ca4ba94..8d828aaf7 100755 --- a/tests/accept/compile/tdictdestruct.nim +++ b/tests/accept/compile/tdictdestruct.nim @@ -5,11 +5,15 @@ type v: TV PDict[TK, TV] = ref TDict[TK, TV] -proc destroyDict[TK, TV](a : PDict[TK, TV]) = +proc fakeNew[T](x: var ref T, destroy: proc (a: ref T)) = + nil + +proc destroyDict[TK, TV](a: PDict[TK, TV]) = return proc newDict[TK, TV](a: TK, b: TV): PDict[TK, TV] = - new(result, destroyDict) - + Fakenew(result, destroyDict) + +# Problem: destroyDict is not instantiated when newDict is instantiated! discard newDict("a", "b") diff --git a/tests/accept/compile/tlexer.nim b/tests/accept/compile/tlexer.nim index f0fac8ec4..968a10bdf 100755 --- a/tests/accept/compile/tlexer.nim +++ b/tests/accept/compile/tlexer.nim @@ -42,8 +42,7 @@ proc main*(infile: string, a, b: int, someverylongnamewithtype = 0, anotherlongthingie = 3) = var myInt: int = 0 - a b = 9 - s: sequence[string] + s: seq[string] # this should be an error! if initBaseLexer(L, infile, 30): nil else: @@ -51,7 +50,7 @@ proc main*(infile: string, a, b: int, someverylongnamewithtype = 0, writeln(stdout, "Success!") call(3, # we use 3 12, # we use 12 - 43 # we use 43 - ) + 43) # we use 43 + -main(ParamStr(1)) +main(ParamStr(1), 9, 0) diff --git a/tests/accept/compile/treadln.nim b/tests/accept/compile/treadln.nim index 7703d5a56..1117ab5f9 100755 --- a/tests/accept/compile/treadln.nim +++ b/tests/accept/compile/treadln.nim @@ -5,8 +5,8 @@ var inp: TFile line: string -if openFile(inp, "readme.txt"): +if open(inp, "readme.txt"): while not EndOfFile(inp): line = readLine(inp) echo("#" & line & "#") - closeFile(inp) + close(inp) diff --git a/tests/accept/compile/ttempl.nim b/tests/accept/compile/ttempl.nim index dcf096671..2c4785325 100755 --- a/tests/accept/compile/ttempl.nim +++ b/tests/accept/compile/ttempl.nim @@ -18,10 +18,10 @@ var i = 0 for item in items(tabs): var content = $i var file: TFile - if openFile(file, changeFileExt(item[1], "html"), fmWrite): + if open(file, changeFileExt(item[1], "html"), fmWrite): write(file, sunsetTemplate(current=item[1], ticker="", content=content, tabs=tabs)) - closeFile(file) + close(file) else: write(stdout, "cannot open file for writing") inc(i) diff --git a/tests/accept/run/mmultim3.nim b/tests/accept/run/mmultim3.nim index ca73ebea6..ca73ebea6 100644..100755 --- a/tests/accept/run/mmultim3.nim +++ b/tests/accept/run/mmultim3.nim diff --git a/tests/accept/run/spec.csv b/tests/accept/run/spec.csv index 172a04464..7cc242a9e 100755 --- a/tests/accept/run/spec.csv +++ b/tests/accept/run/spec.csv @@ -7,8 +7,8 @@ tarray3.nim;3 tassert.nim;assertion failure!this shall be always written tbind1.nim;3 tbind3.nim;1 -tbintre2.nim;halloworld99110223 -tbintree.nim;halloworld99110223 +tbintre2.nim;helloworld99110223 +tbintree.nim;helloworld99110223 tbug499771.nim;TSubRange: 5 from 1 to 10 tbug511622.nim;3 tcasestm.nim;ayyy @@ -38,15 +38,17 @@ tlowhigh.nim;10 tmatrix.nim;111 tmultim1.nim;7 tmultim2.nim;collide: unit, thing collide: unit, thing collide: thing, unit +tmultim3.nim;Hi derived! tnestif.nim;i == 2 tnestprc.nim;10 toop1.nim;34[]o 5 topenarrayrepr.nim;5 - [1] topenlen.nim;7 toverflw.nim;the computation overflowed +toverflw2.nim;Error: unhandled exception: over- or underflow [EOverflow] toverl2.nim;true012 toverlop.nim;3 -toverwr.nim;hallo +toverwr.nim;hello tovfint.nim;works! tpos.nim;6 tprintf.nim;Andreas Rumpf @@ -54,19 +56,24 @@ tprocvar.nim;papbpcpdpe7 tquotewords.nim;thisanexample tregex.nim;key: keyAYes! treguse.nim;055this should be the casehugh +treraise.nim;Error: unhandled exception: bla [ESomeOtherErr] tromans.nim;success tseqcon.nim;Hithere, what's your name?Hathere, what's your name? tseqtuple.nim;fA13msg1falsefB14msg2truefC15msg3false tsets.nim;Ha ein F ist in s! tsidee2.nim;5 tsidee3.nim;5 -tsimmeth.nim;HALLO WORLD! +tsimmeth.nim;HELLO WORLD! tsplit.nim;true tstrange.nim;hallo4 tstrlits.nim;a""long string"""""abc"def tstrutil.nim;ha/home/a1xyz/usr/bin tvardecl.nim;44 +tvariantasgn.nim;came here +tvariantstack.nim;came here tvarnums.nim;Success! tvartup.nim;2 3 +tunhandledexc.nim;Error: unhandled exception: bla [ESomeOtherErr] +twrongexc.nim;Error: unhandled exception [EInvalidValue] txmlgen.nim;<h1><a href="http://force7.de/nimrod">Nimrod</a></h1> txmltree.nim;true diff --git a/tests/accept/run/tcontinuexc.nim b/tests/accept/run/tcontinuexc.nim index 496ee8164..496ee8164 100644..100755 --- a/tests/accept/run/tcontinuexc.nim +++ b/tests/accept/run/tcontinuexc.nim diff --git a/tests/accept/run/tfinally.nim b/tests/accept/run/tfinally.nim index 034653b2b..92c1e500f 100755 --- a/tests/accept/run/tfinally.nim +++ b/tests/accept/run/tfinally.nim @@ -11,5 +11,5 @@ proc main: int = stdout.write("here ") return 3 -echo main() #OUT came here 1 +echo main() #OUT came here 3 diff --git a/tests/accept/run/tfinally2.nim b/tests/accept/run/tfinally2.nim index 10d08e816..10d08e816 100644..100755 --- a/tests/accept/run/tfinally2.nim +++ b/tests/accept/run/tfinally2.nim diff --git a/tests/accept/run/tfinally3.nim b/tests/accept/run/tfinally3.nim index e8d81c893..e8d81c893 100644..100755 --- a/tests/accept/run/tfinally3.nim +++ b/tests/accept/run/tfinally3.nim diff --git a/tests/accept/run/tmultim3.nim b/tests/accept/run/tmultim3.nim index a3271d8d9..a3271d8d9 100644..100755 --- a/tests/accept/run/tmultim3.nim +++ b/tests/accept/run/tmultim3.nim diff --git a/tests/accept/run/tregex.nim b/tests/accept/run/tregex.nim index d9d22d603..43dc8f99c 100755 --- a/tests/accept/run/tregex.nim +++ b/tests/accept/run/tregex.nim @@ -2,16 +2,16 @@ # which is based on the PCRE library import - regexprs - -if "keyA = valueA" =~ r"\s*(\w+)\s*\=\s*(\w+)": - write(stdout, "key: ", matches[1]) -elif "# comment!" =~ r"\s*(\#.*)": - echo("comment: ", matches[1]) -else: - echo("Bug!") + re -if "Username".match("[A-Za-z]+"): +if "keyA = valueA" =~ re"\s*(\w+)\s*\=\s*(\w+)": + write(stdout, "key: ", matches[0]) +elif "# comment!" =~ re"\s*(\#.*)": + echo("comment: ", matches[0]) +else: + echo("Bug!") + +if "Username".match(re"[A-Za-z]+"): echo("Yes!") else: echo("Bug!") diff --git a/tests/accept/run/tvariantasgn.nim b/tests/accept/run/tvariantasgn.nim index 7d51da845..2cc38f434 100755 --- a/tests/accept/run/tvariantasgn.nim +++ b/tests/accept/run/tvariantasgn.nim @@ -21,4 +21,4 @@ nr.intVal = 78 # s = nr # works nr = s # fails! - +echo "came here" diff --git a/tests/accept/run/tvariantstack.nim b/tests/accept/run/tvariantstack.nim index 3df8197f2..e7378ce9a 100755 --- a/tests/accept/run/tvariantstack.nim +++ b/tests/accept/run/tvariantstack.nim @@ -42,5 +42,5 @@ nr.intVal = 78 stack.push(nr) var t = stack.pop() - +echo "came here" |