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

Tests fail in v3 #154

Open
KyleSanderson opened this issue Oct 25, 2024 · 2 comments
Open

Tests fail in v3 #154

KyleSanderson opened this issue Oct 25, 2024 · 2 comments

Comments

@KyleSanderson
Copy link

go test
--- FAIL: Test_Cache_Get (0.00s)
    --- FAIL: Test_Cache_Get/Get_when_item_is_found (0.00s)
        cache_test.go:626:
                Error Trace:    git/ttlcache/cache_test.go:626
                Error:          Should be true
                Test:           Test_Cache_Get/Get_when_item_is_found
--- FAIL: Test_Cache_Has (0.00s)
    cache_test.go:659:
                Error Trace:    git/ttlcache/cache_test.go:659
                Error:          Should be false
                Test:           Test_Cache_Has
--- FAIL: Test_Cache_DeleteExpired (0.00s)
    cache_test.go:770:
                Error Trace:    git/ttlcache/cache_test.go:770
                Error:          Should be empty, but was map[5:0xc000302630]
                Test:           Test_Cache_DeleteExpired
    cache_test.go:771:
                Error Trace:    git/ttlcache/cache_test.go:771
                Error:          map[string]*list.Element{"5":(*list.Element)(0xc000302630)} should not contain "5"
                Test:           Test_Cache_DeleteExpired
    cache_test.go:772:
                Error Trace:    git/ttlcache/cache_test.go:772
                Error:          Not equal:
                                expected: 2
                                actual  : 0
                Test:           Test_Cache_DeleteExpired
    cache_test.go:790:
                Error Trace:    git/ttlcache/cache_test.go:790
                Error:          Not equal:
                                expected: 2
                                actual  : 4
                Test:           Test_Cache_DeleteExpired
--- FAIL: Test_Cache_Touch (0.00s)
    cache_test.go:801:
                Error Trace:    git/ttlcache/cache_test.go:801
                Error:          Should be true
                Test:           Test_Cache_Touch
--- FAIL: Test_Cache_Len (0.00s)
    cache_test.go:813:
                Error Trace:    git/ttlcache/cache_test.go:813
                Error:          Not equal:
                                expected: 1
                                actual  : 2
                Test:           Test_Cache_Len
    cache_test.go:819:
                Error Trace:    git/ttlcache/cache_test.go:819
                Error:          Not equal:
                                expected: 2
                                actual  : 29
                Test:           Test_Cache_Len
--- FAIL: Test_Cache_Keys (0.00s)
    cache_test.go:825:
                Error Trace:    git/ttlcache/cache_test.go:825
                Error:          elements differ

                                extra elements in list B:
                                ([]interface {}) (len=1) {
                                 (string) (len=1) "4"
                                }


                                listA:
                                ([]string) (len=3) {
                                 (string) (len=1) "1",
                                 (string) (len=1) "2",
                                 (string) (len=1) "3"
                                }


                                listB:
                                ([]string) (len=4) {
                                 (string) (len=1) "1",
                                 (string) (len=1) "2",
                                 (string) (len=1) "3",
                                 (string) (len=1) "4"
                                }
                Test:           Test_Cache_Keys
--- FAIL: Test_Cache_Items (0.00s)
    cache_test.go:832:
                Error Trace:    git/ttlcache/cache_test.go:832
                Error:          "map[1:0xc0003177a0 2:0xc000317810 3:0xc000317880 4:0xc0003178f0]" should have 3 item(s), but has 4
                Test:           Test_Cache_Items
--- FAIL: Test_Cache_Range (0.00s)
    cache_test.go:852:
                Error Trace:    git/ttlcache/cache_test.go:852
                Error:          Not equal:
                                expected: []string{"5", "4"}
                                actual  : []string{"6", "5", "4"}

                                Diff:
                                --- Expected
                                +++ Actual
                                @@ -1,2 +1,3 @@
                                -([]string) (len=2) {
                                +([]string) (len=3) {
                                + (string) (len=1) "6",
                                  (string) (len=1) "5",
                Test:           Test_Cache_Range
--- FAIL: Test_Cache_RangeBackwards (0.00s)
    cache_test.go:874:
                Error Trace:    git/ttlcache/cache_test.go:874
                Error:          Not equal:
                                expected: []string{"2", "3", "4"}
                                actual  : []string{"1", "2", "3", "4"}

                                Diff:
                                --- Expected
                                +++ Actual
                                @@ -1,2 +1,3 @@
                                -([]string) (len=3) {
                                +([]string) (len=4) {
                                + (string) (len=1) "1",
                                  (string) (len=1) "2",
                Test:           Test_Cache_RangeBackwards
FAIL
exit status 1
@swithek
Copy link
Contributor

swithek commented Oct 26, 2024

I've just tested this on my machine and everything works fine. The CI runner doesn't report anything like that either. Did you change anything before running this?

@KyleSanderson
Copy link
Author

no, but that was on Windows.

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

2 participants