Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trie is broken #20

Closed
zhulik opened this issue May 29, 2022 · 0 comments
Closed

Trie is broken #20

zhulik opened this issue May 29, 2022 · 0 comments

Comments

@zhulik
Copy link

zhulik commented May 29, 2022

func TestKeys(t *testing.T) {
	tr := trie.New[int]()
	tr.Put("topic1", 1)
	tr.Put("topic2", 2)
	assert.Equal(t, []string{"topic1", "topic2"}, tr.Keys())
}

The result is

--- FAIL: TestKeys (0.00s)
    trie_test.go:68: 
                Error Trace:    trie_test.go:68
                Error:          Not equal: 
                                expected: []string{"topic1", "topic2"}
                                actual  : []string{"topic1", "topi2"}
                            
                                Diff:
                                --- Expected
                                +++ Actual
                                @@ -2,3 +2,3 @@
                                  (string) (len=6) "topic1",
                                - (string) (len=6) "topic2"
                                + (string) (len=5) "topi2"
                                 }
                Test:           TestKeys
FAIL
exit status 1
FAIL    github.com/zhulik/go-eventbus/trie      0.004s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant