MCPcopy
hub / github.com/kashav/fsql / TestCmpHash

Function TestCmpHash

evaluate/compare_test.go:389–423  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

387}
388
389func TestCmpHash(t *testing.T) {
390 type Input struct {
391 o Opts
392 file os.FileInfo
393 typ interface{}
394 }
395
396 type Expected struct {
397 result bool
398 err error
399 }
400
401 type Case struct {
402 input Input
403 expected Expected
404 }
405
406 // TODO: Complete these cases.
407 cases := []Case{}
408
409 for _, c := range cases {
410 actual, err := cmpHash(&c.input.o)
411 if c.expected.err == nil {
412 if err != nil {
413 t.Fatalf("\nExpected no error\n Got %v", err)
414 }
415 if !reflect.DeepEqual(c.expected.result, actual) {
416 t.Fatalf("%v, %v, %v\nExpected: %v\n Got: %v",
417 c.input.o.Operator, c.input.file, c.input.typ, c.expected.result, actual)
418 }
419 } else if !reflect.DeepEqual(c.expected.err, err) {
420 t.Fatalf("\nExpected %v\n Got %v", c.expected.err, err)
421 }
422 }
423}

Callers

nothing calls this directly

Calls 1

cmpHashFunction · 0.85

Tested by

no test coverage detected