q/tests
2025-03-01 12:19:51 +01:00
..
errors Implemented boolean literals 2025-02-26 14:33:41 +01:00
programs Added more tests 2025-03-01 12:19:51 +01:00
errors_test.go Added placeholders for type casts 2025-02-27 00:18:34 +01:00
examples_test.go Updated module path 2025-02-25 17:16:09 +01:00
programs_test.go Simplified Evaluate function 2025-02-27 15:30:44 +01:00
readme.md Improved documentation 2025-02-20 23:54:13 +01:00

Tests

Basic test run:

go test ./... -v

Prettier output using gotestsum:

go run gotest.tools/gotestsum@latest

Coverage

Generate a coverage profile:

go test -coverpkg=./... -coverprofile=cover.out ./...

View the data:

go tool cover -func cover.out
go tool cover -html cover.out

Benchmarks

Run all benchmarks:

go test ./tests -run='^$' -bench=. -benchmem

Examples only:

go test ./tests -run='^$' -bench=Examples/ -benchmem

Profiling

Generate a profile:

go test ./tests -run='^$' -bench=Examples/ -benchmem -cpuprofile cpu.out -memprofile mem.out

View the data:

go tool pprof --nodefraction=0.1 -http=:8080 ./cpu.out
go tool pprof --nodefraction=0.1 -http=:8080 ./mem.out