Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c3ebebe
commit 0f3c819
Showing
7 changed files
with
78 additions
and
14 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
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package run | ||
|
||
object envtest extends App: | ||
println("Hello " + sys.props("key")) |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!dist/target/pack/bin/scala | ||
|
||
def main(args: Array[String]): Unit = | ||
println("Hello " + util.Properties.propOrNull("key")) |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package run | ||
|
||
object envtest extends App: | ||
println("Hello " + sys.props("key")) |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package dotty.tools.repl | ||
|
||
import org.junit.Assert._ | ||
import org.junit.Test | ||
|
||
class EnvPropsTest extends ReplTest(options = Array("-J-Dkey=value", "-Dkey2=value2")) { | ||
@Test def fromDashJDashD = fromInitialState { implicit s => | ||
run("util.Properties.propOrNull(\"key\")") | ||
assertTrue(storedOutput().contains("val res0: String = value")) | ||
} | ||
|
||
@Test def fromDashD = fromInitialState { implicit s => | ||
run("util.Properties.propOrNull(\"key2\")") | ||
assertTrue(storedOutput().contains("val res0: String = value2")) | ||
} | ||
} | ||
|
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