package storetest

import (
	
	

	
)

var (
	dirsToAdd  = []string{"/usr/local", "/usr", "/usr/bin", "/usr"}
	black      = map[string]struct{}{"/usr/local": {}}
	wantedDirs = []store.Dir{
		{
			Path:  "/usr",
			Score: store.DirScoreIncrement*store.DirScoreDecay*store.DirScoreDecay + store.DirScoreIncrement,
		},
		{
			Path:  "/usr/bin",
			Score: store.DirScoreIncrement * store.DirScoreDecay,
		},
	}
	dirToDel           = "/usr"
	wantedDirsAfterDel = []store.Dir{
		{
			Path:  "/usr/bin",
			Score: store.DirScoreIncrement * store.DirScoreDecay,
		},
	}
)

// TestDir tests the directory history functionality of a Store.
func ( *testing.T,  store.Store) {
	for ,  := range dirsToAdd {
		 := .AddDir(, 1)
		if  != nil {
			.Errorf("tStore.AddDir(%q) => %v, want <nil>", , )
		}
	}

	,  := .Dirs(black)
	if  != nil || !reflect.DeepEqual(, wantedDirs) {
		.Errorf(`tStore.ListDirs() => (%v, %v), want (%v, <nil>)`,
			, , wantedDirs)
	}

	.DelDir(dirToDel)
	,  = .Dirs(black)
	if  != nil || !reflect.DeepEqual(, wantedDirsAfterDel) {
		.Errorf(`After DelDir("/usr"), tStore.ListDirs() => (%v, %v), want (%v, <nil>)`,
			, , wantedDirsAfterDel)
	}
}