diff options
author | Araq <rumpf_a@web.de> | 2010-10-21 00:12:14 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2010-10-21 00:12:14 +0200 |
commit | 765366c1f377fbd9507e942385170b546d9d34d0 (patch) | |
tree | bffec904c5b980aa7b9c0961cda18d5dd30638ae /tests/accept/compile | |
parent | 53cd61546dc798fc0f08baf0813f579a90d7e766 (diff) | |
download | Nim-765366c1f377fbd9507e942385170b546d9d34d0.tar.gz |
version 0.8.10
Diffstat (limited to 'tests/accept/compile')
-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 |
5 files changed, 83 insertions, 12 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) |