lib/dirstore_test.go
raw| 1 | package lib_test |
| 2 | |
| 3 | import ( |
| 4 | "reflect" |
| 5 | "testing" |
| 6 | |
| 7 | "git.sr.ht/~rjarry/aerc/lib" |
| 8 | "git.sr.ht/~rjarry/aerc/models" |
| 9 | ) |
| 10 | |
| 11 | func TestDirStore_List(t *testing.T) { |
| 12 | dirs := []string{"a/c", "x", "a/b", "d"} |
| 13 | dirstore := lib.NewDirStore() |
| 14 | for _, d := range dirs { |
| 15 | dirstore.SetMessageStore(&models.Directory{Name: d}, nil) |
| 16 | } |
| 17 | for range 10 { |
| 18 | if !reflect.DeepEqual(dirstore.List(), dirs) { |
| 19 | t.Errorf("order does not match") |
| 20 | return |
| 21 | } |
| 22 | } |
| 23 | } |