diff --git a/protocol/src/test/go/benchmark2.go b/protocol/src/test/go/benchmark_fibonacci_test.go similarity index 89% rename from protocol/src/test/go/benchmark2.go rename to protocol/src/test/go/benchmark_fibonacci_test.go index a9cfd2a5..a7fe6a0a 100644 --- a/protocol/src/test/go/benchmark2.go +++ b/protocol/src/test/go/benchmark_fibonacci_test.go @@ -2,17 +2,18 @@ package main import ( "fmt" + "testing" "time" ) -func main() { +func TestFibonacci(t *testing.T) { // 预热 - test() + testFibonacci() // 正式执行 - test() + testFibonacci() } -func test() { +func testFibonacci() { var startTime = time.Now() for i := 0; i < 10000; i++ { fibonacci(32) @@ -51,4 +52,4 @@ public class MainTest { return fibonacci(i - 2) + fibonacci(i - 1); } } - */ +*/ diff --git a/protocol/src/test/go/benchmark1.go b/protocol/src/test/go/benchmark_sort_test.go similarity index 92% rename from protocol/src/test/go/benchmark1.go rename to protocol/src/test/go/benchmark_sort_test.go index 96800cba..deb8912a 100644 --- a/protocol/src/test/go/benchmark1.go +++ b/protocol/src/test/go/benchmark_sort_test.go @@ -2,17 +2,18 @@ package main import ( "fmt" + "testing" "time" ) -func main() { +func TestBubbleSort(t *testing.T) { // 预热 - test() + testBubbleSort() // 正式执行 - test() + testBubbleSort() } -func test() { +func testBubbleSort() { var startTime = time.Now() const NUM int = 100000000 for i := 0; i < NUM; i++ {