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

Function TestIsBalancedHandlesOrdering

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

Source from the content-addressed store, hash-verified

60}
61
62func TestIsBalancedHandlesOrdering(t *testing.T) {
63 input := "([)]"
64
65 got := IsBalanced(input)
66 want := false
67
68 if got != want {
69 t.Errorf("\nInput: %s\nGot: %v\nWant: %v\n", input, got, want)
70 }
71}
72
73func BenchmarkIsBalanced(b *testing.B) {
74 input := "{[()]}"

Callers

nothing calls this directly

Calls 1

IsBalancedFunction · 0.85

Tested by

no test coverage detected