加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
test.sh 1.77 KB
一键复制 编辑 原始数据 按行查看 历史
zxh0 提交于 2021-07-31 11:42 . Switch to Go mod & GitHub Actions
#!/bin/sh
set -ex
cd v1/code/go/src/jvmgo
# export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/
go run jvmgo/ch01 -version | grep -q "version 0.0.1"
go run jvmgo/ch02 java.lang.Object | grep -q "class data"
go run jvmgo/ch03 java.lang.Object | grep -q "this class: java/lang/Object"
go run jvmgo/ch04 java.lang.Object 2>&1 | grep -q "100"
go run jvmgo/ch05 -cp ../../../java/example.jar jvmgo.book.ch05.GaussTest 2>&1 | grep -q "5050"
go run jvmgo/ch06 -cp ../../../java/example.jar jvmgo.book.ch06.MyObject | grep -q "32768"
go run jvmgo/ch07 -cp ../../../java/example.jar jvmgo.book.ch07.FibonacciTest | grep -q "832040"
go run jvmgo/ch08 -cp ../../../java/example.jar jvmgo.book.ch01.HelloWorld | grep -q "Hello, world!"
go run jvmgo/ch08 -cp ../../../java/example.jar jvmgo.book.ch08.PrintArgs foo bar | tr -d '\n' | grep -q "foobar"
go run jvmgo/ch09 -cp ../../../java/example.jar jvmgo.book.ch09.GetClassTest | grep -q "Ljava.lang.String;"
go run jvmgo/ch09 -cp ../../../java/example.jar jvmgo.book.ch09.StringTest | tr -d '\n' | grep -q "truefalsetrue"
go run jvmgo/ch09 -cp ../../../java/example.jar jvmgo.book.ch09.ObjectTest | tr -d '\n' | grep -q "falsetrue"
go run jvmgo/ch09 -cp ../../../java/example.jar jvmgo.book.ch09.CloneTest | grep -q "3.14"
go run jvmgo/ch09 -cp ../../../java/example.jar jvmgo.book.ch09.BoxTest | grep -q "1, 2, 3"
go run jvmgo/ch10 -cp ../../../java/example.jar jvmgo.book.ch10.ParseIntTest 123 | grep -q "123"
go run jvmgo/ch10 -cp ../../../java/example.jar jvmgo.book.ch10.ParseIntTest abc 2>&1 | grep 'For input string: "abc"'
go run jvmgo/ch10 -cp ../../../java/example.jar jvmgo.book.ch10.ParseIntTest 2>&1 | grep -q "at jvmgo"
go run jvmgo/ch11 -cp ../../../java/example.jar jvmgo.book.ch01.HelloWorld | grep -q "Hello, world!"
echo OK
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化