Tests for issue #47
This commit is contained in:
@@ -3,6 +3,7 @@ package tests;
|
||||
import utest.Test;
|
||||
import utest.Assert;
|
||||
|
||||
import hank.HankAssert;
|
||||
using hank.Extensions;
|
||||
import hank.HInterface;
|
||||
import hank.StoryTree;
|
||||
@@ -40,4 +41,14 @@ class HInterfaceTest extends utest.Test {
|
||||
assertExpr('test2', true);
|
||||
}
|
||||
|
||||
public function testNullErrors() {
|
||||
HankAssert.throws(function() {
|
||||
hInterface.evaluateExpr('undeclared_variable');
|
||||
});
|
||||
}
|
||||
|
||||
public function testIfIdiom() {
|
||||
HankAssert.equals("", hInterface.evaluateExpr('if (false) "something"'));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -11,12 +11,12 @@ class StoryTest extends hank.StoryTestCase {
|
||||
|
||||
for (file in files) {
|
||||
if (StringTools.endsWith(file, '.hlog')) {
|
||||
trace(' Running ${file}');
|
||||
|
||||
var disabled = file.indexOf("disabled") != -1;
|
||||
var debug = file.indexOf("debug") != -1;
|
||||
var partial = file.indexOf("partial") != -1;
|
||||
if (!disabled) {
|
||||
trace(' Running ${file}');
|
||||
validateAgainstTranscript('examples/${folder}/main.hank', 'examples/${folder}/${file}', !partial);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user