Created
February 18, 2010 10:40
-
-
Save clairvy/307561 to your computer and use it in GitHub Desktop.
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
*.class |
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
public class AA { | |
public int func(int x) { | |
return x + 2; | |
} | |
} |
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
do : build | |
scala test.scala | |
echo :l test.scala | scala | |
build: AA.class | |
AA.class : AA.java | |
javac $^ | |
clean : | |
$(RM) $(RMF) *.class | |
test : | |
prove ./test.pl |
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
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use Test::More tests => 2; | |
my $expect = <<"EOL"; | |
12 | |
EOL | |
is(`scala test.scala`, $expect); | |
{ | |
my $ret = `echo :l test.scala | scala`; | |
$ret =~ s/\A.*aa:[^\n]+[\n]+//ms; | |
$ret =~ s/scala> //ms; | |
chomp($ret); | |
is($ret, $expect); | |
} |
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
val aa = new AA; | |
println(aa.func(10)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment