MCPcopy Create free account
hub / github.com/gokcehan/lf / TestSplitKeys

Function TestSplitKeys

eval_test.go:565–593  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

563}
564
565func TestSplitKeys(t *testing.T) {
566 inps := []struct {
567 s string
568 keys []string
569 }{
570 {"", nil},
571 {"j", []string{"j"}},
572 {"jk", []string{"j", "k"}},
573 {"1j", []string{"1", "j"}},
574 {"42j", []string{"4", "2", "j"}},
575 {"<space>", []string{"<space>"}},
576 {"j<space>", []string{"j", "<space>"}},
577 {"j<space>k", []string{"j", "<space>", "k"}},
578 {"1j<space>k", []string{"1", "j", "<space>", "k"}},
579 {"1j<space>1k", []string{"1", "j", "<space>", "1", "k"}},
580 {"<>", []string{"<>"}},
581 {"<space", []string{"<space"}},
582 {"<space<", []string{"<space<"}},
583 {"<space<>", []string{"<space<>"}},
584 {"><space>", []string{">", "<space>"}},
585 {"><space>>", []string{">", "<space>", ">"}},
586 }
587
588 for _, inp := range inps {
589 if keys := splitKeys(inp.s); !reflect.DeepEqual(keys, inp.keys) {
590 t.Errorf("at input '%s' expected '%v' but got '%v'", inp.s, inp.keys, keys)
591 }
592 }
593}
594
595func TestApplyBoolOpt(t *testing.T) {
596 tests := []struct {

Callers

nothing calls this directly

Calls 1

splitKeysFunction · 0.85

Tested by

no test coverage detected