File tree Expand file tree Collapse file tree 4 files changed +38
-1
lines changed
Expand file tree Collapse file tree 4 files changed +38
-1
lines changed Original file line number Diff line number Diff line change @@ -34,4 +34,6 @@ neko.sln
3434bin
3535/extra /chocolatey /LICENSE
3636/extra /chocolatey /* .zip
37- /extra /chocolatey /* .nupkg
37+ /extra /chocolatey /* .nupkg
38+
39+ /tests /* .n
Original file line number Diff line number Diff line change @@ -782,6 +782,8 @@ add_test(NAME nekotools
782782 WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
783783)
784784
785+ add_subdirectory (tests)
786+
785787#######################
786788
787789# debian source packages
Original file line number Diff line number Diff line change 1+ file (MAKE_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} /tests/)
2+
3+ add_test (NAME build_goto.n
4+ COMMAND nekoc -o ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} /tests/ ${CMAKE_SOURCE_DIR} /tests/goto.neko
5+ WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
6+ )
7+
8+ add_test (NAME run_goto.n
9+ COMMAND nekovm tests/goto.n
10+ WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
11+ )
12+
13+ set_tests_properties (run_goto.n PROPERTIES
14+ PASS_REGULAR_EXPRESSION "startcontinue1continue2end"
15+ FIXTURES_SETUP build_goto.n
16+ )
Original file line number Diff line number Diff line change 1+ $print("start");
2+ $goto(forward);
3+
4+ $print("skip");
5+
6+ backward:
7+ $print("continue2");
8+ $goto(end);
9+
10+ forward:
11+ $print("continue1");
12+ $goto(backward);
13+
14+ $print("skip");
15+
16+ end:
17+ $print("end");
You can’t perform that action at this time.
0 commit comments