Refactor travis testing

This commit is contained in:
2021-06-07 12:36:22 -06:00
parent 32698b2d5b
commit 610a977b7c
77 changed files with 76 additions and 116 deletions

View File

@@ -0,0 +1,11 @@
package test;
import kiss.Kiss;
import kiss.Prelude;
import nat.BoolExpInterp;
import nat.Archive;
import nat.Lib;
import nat.components.*;
@:build(kiss.Kiss.build())
class TestMain {}

View File

@@ -0,0 +1,28 @@
// TODO external programs need to be able to find and (load) this path to get the macros:
// ^ That should be solved by allowing an optional first argument to load that is a symbol
// of a library name that can be used to resolve the source dir in the user's Haxelib maybe?
(load "../nat/Lib.kiss")
(defun :Void main []
(assert (BoolExpInterp.eval "true" []))
(assert !(BoolExpInterp.eval "false" []))
(assert !(BoolExpInterp.eval "flag" []))
(assert (BoolExpInterp.eval "flag" ["flag"]))
(assert !(BoolExpInterp.eval "(and flag false)" ["flag"]))
(assert (BoolExpInterp.eval "(or flag otherFlag)" ["otherFlag"]))
//trace(error);
(let [archive
(new Archive "src/test/example-archive")
song1
(dictGet archive.entries "song1")
song2
(dictGet archive.entries "song2")]
(assert (hasComponent song1 Tags))
(assert (hasComponent song2 Tags))
(assert (tagsMatch archive song1 "(and song western)"))
(assert !(tagsMatch archive song1 "(and song religious)"))
(assert (tagsMatch archive song2 "(and song religious)"))
(assert !(tagsMatch archive song2 "(and song western)"))
))

View File

@@ -0,0 +1 @@
"Rafael Krux"

View File

@@ -0,0 +1 @@
"Kevin MacLeod"

View File

@@ -0,0 +1 @@
"Adventure"

View File

@@ -0,0 +1 @@
"Ancient Rite"

View File

@@ -0,0 +1,4 @@
[
["song", 1],
["western", 1]
]

View File

@@ -0,0 +1,4 @@
[
["song", 1],
["religious", 1]
]

View File

@@ -0,0 +1,11 @@
{
"id": "song1",
"components": [
["Name", "name1"],
["Author", "author1"],
["Tags", "tags1"]
],
"files": [
"Adventure.mp3"
]
}

View File

@@ -0,0 +1,11 @@
{
"id": "song2",
"components": [
["Name", "name2"],
["Author", "author2"],
["Tags", "tags2"]
],
"files": [
"Ancient Rite.mp3"
]
}