Skip to content

Commit

Permalink
tests: runner test
Browse files Browse the repository at this point in the history
  • Loading branch information
Rico040 committed Jul 23, 2024
1 parent ee0e782 commit ece2204
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
nimcache/
nimblecache/
htmldocs/
testresults/
testresults.html
outputGotten.txt
*.exe
3 changes: 3 additions & 0 deletions nimhw.nimble
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ bin = @["nimhw"]
# Dependencies

requires "nim >= 2.0.8"

task test, "Run all tests":
exec "testament --megatest:off all"
4 changes: 2 additions & 2 deletions src/nimhw.nim
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# distribution, for details about the copyright.
#
import std/[os, parseopt], strutils
import runner, compiler, repl
import nimhw/[runner, compiler, repl]

const
Usage = """
Expand Down Expand Up @@ -58,4 +58,4 @@ if positionalArgs.len > 0 and not compileFlag:


# echo "positionalArgs: ", positionalArgs
# echo "code: ", code
# echo "code: ", code
21 changes: 21 additions & 0 deletions tests/basic/tRunner.nim
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
discard """
output: '''
Hello!
Hello, Hello!
World!
World, World!
Hello, World!
World, Hello!
quine
'''
"""
import ../../src/nimhw/runner
echo run("h")
echo run("hh")
echo run("w")
echo run("ww")
echo run("hw")
echo run("wh")
echo run("quine")

0 comments on commit ece2204

Please sign in to comment.