Skip to content

Commit fea2954

Browse files
committed
add some more test scripts
1 parent 3d016cd commit fea2954

File tree

6 files changed

+27
-0
lines changed

6 files changed

+27
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// ./srp --script test-scripts/main-requiring-import.sc --predef test-scripts/sayHello-function.sc
2+
println(sayHello("Michael"))

test-scripts/main-using-import.sc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// ./srp --script test-scripts/main-using-import.sc
2+
3+
//> using file sayHello-function.sc
4+
println(sayHello("Michael"))

test-scripts/multiple-mains.sc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// ./srp --script test-scripts/multiple-mains.sc --command foo
2+
3+
@main def foo() = {
4+
println("in foo")
5+
}
6+
7+
@main def bar() = {
8+
println("in bar")
9+
}
10+

test-scripts/runBeforeCode-main.sc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// ./srp --script test-scripts/runBeforeCode-main.sc --runBefore 'import Byte.MinValue'
2+
3+
@main def foo() = {
4+
// val x: Int = "a string" // uncomment to check line number reporting
5+
println(s"test-main2 $MinValue")
6+
}
7+

test-scripts/runBeforeCode.sc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// ./srp --script test-scripts/runBeforeCode.sc --runBefore 'import Byte.MinValue'
2+
// val x: Int = "a string" // uncomment to check line number reporting
3+
println(s"test-main1 $MinValue")

test-scripts/sayHello-function.sc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
def sayHello(to: String) = s"Hello, $to"

0 commit comments

Comments
 (0)