diff --git a/examples.txt b/examples.txt index 3f1d3e0..88fb70c 100644 --- a/examples.txt +++ b/examples.txt @@ -63,7 +63,7 @@ Line Filters File Paths Directories Temporary Files and Directories -Testing +Testing and Benchmarking Command-Line Arguments Command-Line Flags Command-Line Subcommands diff --git a/examples/testing/main_test.go b/examples/testing-and-benchmarking/main_test.go similarity index 100% rename from examples/testing/main_test.go rename to examples/testing-and-benchmarking/main_test.go diff --git a/examples/testing/main_test.sh b/examples/testing-and-benchmarking/main_test.sh similarity index 90% rename from examples/testing/main_test.sh rename to examples/testing-and-benchmarking/main_test.sh index 1e922b6..73411fe 100644 --- a/examples/testing/main_test.sh +++ b/examples/testing-and-benchmarking/main_test.sh @@ -15,7 +15,7 @@ $ go test -v --- PASS: TestIntMinTableDriven/0,-1 (0.00s) --- PASS: TestIntMinTableDriven/-1,0 (0.00s) PASS -ok examples/testing 0.023s +ok examples/testing-and-benchmarking 0.023s # Run all benchmarks in the current project. All tests # are run prior to benchmarks. The `bench` flag filters @@ -26,4 +26,4 @@ goarch: arm64 pkg: examples/testing BenchmarkIntMin-8 1000000000 0.3136 ns/op PASS -ok examples/testing 0.351s +ok examples/testing-and-benchmarking 0.351s diff --git a/examples/testing/testing.hash b/examples/testing-and-benchmarking/testing.hash similarity index 100% rename from examples/testing/testing.hash rename to examples/testing-and-benchmarking/testing.hash diff --git a/public/command-line-arguments b/public/command-line-arguments index 9ccbc4a..7632416 100644 --- a/public/command-line-arguments +++ b/public/command-line-arguments @@ -9,7 +9,7 @@ onkeydown = (e) => { if (e.key == "ArrowLeft") { - window.location.href = 'testing'; + window.location.href = 'testing-and-benchmarking'; } diff --git a/public/index.html b/public/index.html index 279ae86..125edc3 100644 --- a/public/index.html +++ b/public/index.html @@ -157,7 +157,7 @@
- Next example: Testing. + Next example: Testing and Benchmarking.
diff --git a/public/testing-and-benchmarking b/public/testing-and-benchmarking new file mode 100644 index 0000000..975dbb2 --- /dev/null +++ b/public/testing-and-benchmarking @@ -0,0 +1,289 @@ + + + + +
+ Run all tests in the current project in verbose mode. + + |
+
+
+ +$ go test -v +== RUN TestIntMinBasic +--- PASS: TestIntMinBasic (0.00s) +=== RUN TestIntMinTableDriven +=== RUN TestIntMinTableDriven/0,1 +=== RUN TestIntMinTableDriven/1,0 +=== RUN TestIntMinTableDriven/2,-2 +=== RUN TestIntMinTableDriven/0,-1 +=== RUN TestIntMinTableDriven/-1,0 +--- PASS: TestIntMinTableDriven (0.00s) + --- PASS: TestIntMinTableDriven/0,1 (0.00s) + --- PASS: TestIntMinTableDriven/1,0 (0.00s) + --- PASS: TestIntMinTableDriven/2,-2 (0.00s) + --- PASS: TestIntMinTableDriven/0,-1 (0.00s) + --- PASS: TestIntMinTableDriven/-1,0 (0.00s) +PASS +ok examples/testing-and-benchmarking 0.023s+ |
+
+ Run all benchmarks in the current project. All tests
+are run prior to benchmarks. The |
+
+
+ +$ go test -bench=. +goos: darwin +goarch: arm64 +pkg: examples/testing +BenchmarkIntMin-8 1000000000 0.3136 ns/op +PASS +ok examples/testing-and-benchmarking 0.351s+ |
+
+ Next example: Command-Line Arguments. +
+ + + + +