A mature testing framework for Go designed to help you write expressive specs
Overall
score
97%
Build a test suite runner for a simple calculator package that demonstrates proper test suite initialization and configuration.
Create a calculator package with basic operations (add, subtract, multiply, divide) and implement a comprehensive test suite with the following requirements:
Calculator Implementation - Create a calculator.go file with:
Add(a, b int) int function that returns the sum of two integersSubtract(a, b int) int function that returns the differenceMultiply(a, b int) int function that returns the productDivide(a, b float64) (float64, error) function that returns the quotient or an error for division by zeroTest Suite Setup - Create a test suite that:
Test Specifications - Write tests that:
Integration - Ensure the test suite:
go test commandInput:
go test -vExpected Output (partial match):
Running Suite:The output should show that the test suite is running and at least one addition test passes. { @test }
Input:
go test -vExpected Output (partial match): The test suite should include a test that verifies division by zero returns an error. The test should pass. { @test }
Input:
go test -vExpected Output: The test suite should execute with the configured parallel settings. All tests should pass. { @test }
A mature testing framework for Go designed to help you write expressive specs.
Provides assertion and matcher support for tests.
.
├── calculator.go
├── calculator_test.go
└── suite_test.go_test.goInstall with Tessl CLI
npx tessl i tessl/golang-github-com-onsi-ginkgo-v2docs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10