diff options
author | ywang <yw05@forksworld.de> | 2021-02-02 19:49:02 +0100 |
---|---|---|
committer | ywang <yw05@forksworld.de> | 2021-08-04 21:25:19 +0200 |
commit | 9cc69e224f7a08c8d3e4acba65654704e60c5e32 (patch) | |
tree | 266ce8c048ab8607451652e19860715717dda34f /advtrains/tests | |
parent | 2c4e4f80c89f403f6387358568d66a3dd5db8000 (diff) | |
download | advtrains-9cc69e224f7a08c8d3e4acba65654704e60c5e32.tar.gz advtrains-9cc69e224f7a08c8d3e4acba65654704e60c5e32.tar.bz2 advtrains-9cc69e224f7a08c8d3e4acba65654704e60c5e32.zip |
Add command to view generated lua code; add unittests for repeating code
Diffstat (limited to 'advtrains/tests')
-rw-r--r-- | advtrains/tests/atcjit_spec.lua | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/advtrains/tests/atcjit_spec.lua b/advtrains/tests/atcjit_spec.lua index 8e2a8b7..6d8b3f4 100644 --- a/advtrains/tests/atcjit_spec.lua +++ b/advtrains/tests/atcjit_spec.lua @@ -154,3 +154,18 @@ describe("ATC track with invalid I condition", function() local t = { atc_command = "I?;" } thisatc("should report an error", t, {}, "Invalid I statement", t) end) + +describe("ATC track reusing existing code", function() + local t = { atc_command = " B12WB8WBBWOLD15ORD15OCD1RS10WSM", tarvelocity = 15 } + thisatc("should do the same thing as in the first test", t, {}, nil, { + atc_brake_target = 12, + atc_command = "B8WBBWOLD15ORD15OCD1RS10WSM", + atc_wait_finish = true, + tarvelocity = 12 + }) +end) + +describe("ATC track reusing malformed code", function() + local t = {atc_command = "I?;"} + thisatc("Should report the invalid I statement", t, {}, "Invalid I statement", t) +end) |