Skip to content

Commit 5f28a8d

Browse files
committed
Added regression test for #185
1 parent 689a6bf commit 5f28a8d

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

test/resources/home_dir_include.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
echo "fun foo() = 42" > ~/.kscript_home_include.kts
2+
3+
echo '
4+
//INCLUDE ~/.kscript_home_include.kts
5+
println(foo())
6+
' > home_dir_master.kts
7+
8+
kscript home_dir_master.kts

test/test_suite.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,10 +245,14 @@ assert 'kscript "println(args.size)" "--params foo"' 1 ## make sure dash args a
245245
assert 'kscript "println(args.size)" "foo bar"' 1 ## allow for spaces
246246
assert 'kscript "println(args[0])" "foo bar"' "foo bar" ## make sure quotes are not propagated into args
247247

248-
## prevent regression of 181
248+
## prevent regression of #181
249249
assert 'echo "println(123)" > 123foo.kts; kscript 123foo.kts' "123"
250250

251251

252+
## prevent regression of #185
253+
assert "source ${KSCRIPT_HOME}/test/resources/home_dir_include.sh" "42"
254+
255+
252256
kscript_nocall() { kotlin -classpath ${KSCRIPT_HOME}/build/libs/kscript.jar kscript.app.KscriptKt "$@";}
253257
export -f kscript_nocall
254258

0 commit comments

Comments
 (0)