-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Refactor, set up tests using dropecho.testing.
Remove old munit. Set up python build.
- Loading branch information
1 parent
d955af7
commit d1144f3
Showing
15 changed files
with
304 additions
and
457 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"haxe.hxml": "test.hxml" | ||
"haxe.hxml": "build.hxml" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,4 +18,6 @@ targets/js-esm.hxml | |
--next | ||
targets/cs.hxml | ||
--next | ||
targets/python.hxml | ||
--next | ||
targets/docs.hxml |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,29 @@ | ||
# CSharp | ||
-main TestMain | ||
-lib dropecho.interop | ||
-lib munit | ||
-lib hamcrest | ||
-lib seedyrng | ||
|
||
-cp src | ||
-cp test | ||
|
||
-D dce=no | ||
|
||
-D dll_import | ||
-D no-root | ||
-cs build/cs_test | ||
--next | ||
|
||
## JavaScript NodeJS | ||
-main TestMain | ||
-lib dropecho.interop | ||
-lib munit | ||
-lib hamcrest | ||
-lib seedyrng | ||
-lib dropecho.interop | ||
-lib dropecho.testing | ||
-lib utest | ||
|
||
-cp src | ||
-cp test | ||
|
||
-D dce=no | ||
--each | ||
|
||
# --next | ||
-lib hxnodejs | ||
-js build/js_test.cjs | ||
-D js-es=6 | ||
-js artifacts/js_test.cjs | ||
|
||
# --next | ||
# -lib hxnodejs | ||
# -lib genes | ||
# -js artifacts/js_esm_test/test.js | ||
# | ||
# --next | ||
# -D net-ver=40 | ||
# -cs artifacts/cs_test | ||
|
||
# --next | ||
# -python artifacts/python_test | ||
|
||
# ## HashLink | ||
# --next | ||
# -hl build/hl_test.hl | ||
# -neko artifacts/neko_test.n |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
40 changes: 17 additions & 23 deletions
40
test/storygen/FunctionsTest.hx → test/storygen/Functions_Tests.hx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,57 @@ | ||
package storygen; | ||
|
||
import dropecho.storygen.Generator.WordList; | ||
import massive.munit.Assert; | ||
import dropecho.storygen.*; | ||
import utest.Assert; | ||
|
||
class FunctionsTest { | ||
class Functions_Tests extends utest.Test { | ||
var generator:Generator; | ||
|
||
@Before | ||
public function setup() { | ||
var config = ["test" => (['a'] : WordList), "test2" => (['b'] : WordList)]; | ||
generator = new Generator(config); | ||
} | ||
|
||
@Test | ||
public function repeat() { | ||
public function test_repeat() { | ||
var repeat = Functions.get("repeat"); | ||
Assert.isNotNull(random); | ||
Assert.notNull(repeat); | ||
|
||
var out = repeat(generator, ["test2", "4", "4"]); | ||
Assert.areEqual("b b b b", out); | ||
Assert.equals("b b b b", out); | ||
} | ||
|
||
@Test | ||
public function random() { | ||
public function test_random() { | ||
var random = Functions.get("random"); | ||
Assert.isNotNull(random); | ||
Assert.notNull(random); | ||
|
||
var out = random(generator, ["1", "1"]); | ||
Assert.areEqual("1", out); | ||
Assert.equals("1", out); | ||
} | ||
|
||
@Test | ||
public function switch_test() { | ||
public function test_switch_test() { | ||
generator.memory.set("bar", "test2"); | ||
var sw = Functions.get("switch"); | ||
Assert.isNotNull(sw); | ||
Assert.notNull(sw); | ||
|
||
var out = sw(generator, ["bar", "test=>test", "test2=>test2"]); | ||
Assert.areEqual("#test2#", out); | ||
Assert.equals("#test2#", out); | ||
} | ||
|
||
@Test | ||
public function swit_to_null() { | ||
public function test_switch_to_null() { | ||
generator.memory.set("bar", "test2"); | ||
var sw = Functions.get("switch"); | ||
Assert.isNotNull(sw); | ||
Assert.notNull(sw); | ||
|
||
var out = sw(generator, ["bar", "test=>test"]); | ||
Assert.areEqual("", out); | ||
Assert.equals("", out); | ||
} | ||
|
||
@Test | ||
public function switch_test_default() { | ||
public function test_switch_test_default() { | ||
generator.memory.set("bar", "test2"); | ||
var sw = Functions.get("switch"); | ||
Assert.isNotNull(sw); | ||
Assert.notNull(sw); | ||
|
||
var out = sw(generator, ["bar", "test=>test", "_=>default"]); | ||
Assert.areEqual("default", out); | ||
Assert.equals("default", out); | ||
} | ||
} |
Oops, something went wrong.