MCPcopy Index your code
hub / github.com/dnote/dnote / TestCheckNoteInList

Function TestCheckNoteInList

pkg/cli/cmd/sync/sync_test.go:2961–3021  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

2959}
2960
2961func TestCheckNoteInList(t *testing.T) {
2962 list := syncList{
2963 Notes: map[string]client.SyncFragNote{
2964 "n1-uuid": {
2965 UUID: "n1-uuid",
2966 },
2967 "n2-uuid": {
2968 UUID: "n2-uuid",
2969 },
2970 },
2971 Books: map[string]client.SyncFragBook{
2972 "b1-uuid": {
2973 UUID: "b1-uuid",
2974 },
2975 "b2-uuid": {
2976 UUID: "b2-uuid",
2977 },
2978 },
2979 ExpungedNotes: map[string]bool{
2980 "n3-uuid": true,
2981 "n4-uuid": true,
2982 },
2983 ExpungedBooks: map[string]bool{
2984 "b3-uuid": true,
2985 "b4-uuid": true,
2986 },
2987 MaxUSN: 1,
2988 MaxCurrentTime: 2,
2989 }
2990
2991 testCases := []struct {
2992 uuid string
2993 expected bool
2994 }{
2995 {
2996 uuid: "n1-uuid",
2997 expected: true,
2998 },
2999 {
3000 uuid: "n2-uuid",
3001 expected: true,
3002 },
3003 {
3004 uuid: "n3-uuid",
3005 expected: true,
3006 },
3007 {
3008 uuid: "n4-uuid",
3009 expected: true,
3010 },
3011 {
3012 uuid: "nonexistent-note-uuid",
3013 expected: false,
3014 },
3015 }
3016
3017 for idx, tc := range testCases {
3018 got := checkNoteInList(tc.uuid, &list)

Callers

nothing calls this directly

Calls 2

EqualFunction · 0.92
checkNoteInListFunction · 0.85

Tested by

no test coverage detected