MCPcopy Create free account
hub / github.com/TheAlgorithms/Go / TestIsBalancedHandlesEmpty

Function TestIsBalancedHandlesEmpty

other/nested/nestedbrackets_test.go:29–38  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

27}
28
29func TestIsBalancedHandlesEmpty(t *testing.T) {
30 input := ""
31
32 got := IsBalanced(input)
33 want := true
34
35 if got != want {
36 t.Errorf("\nInput: %s\nGot: %v\nWant: %v\n", input, got, want)
37 }
38}
39
40func TestIsBalancedHandlesOneChar(t *testing.T) {
41 input := "{"

Callers

nothing calls this directly

Calls 1

IsBalancedFunction · 0.85

Tested by

no test coverage detected