diff options
| author | Eyal Posener <[email protected]> | 2017-05-11 20:28:31 +0300 |
|---|---|---|
| committer | Eyal Posener <[email protected]> | 2017-05-11 20:33:29 +0300 |
| commit | 967bae76f3132c210e6275653f9b603593973858 (patch) | |
| tree | 0f71371443e6d5dde4fcf9e49c63b9afbab28a55 /complete_test.go | |
| parent | a28594d28ea9a838f174641a411fd537c2c495b9 (diff) | |
Add Predictor interface
Diffstat (limited to 'complete_test.go')
| -rw-r--r-- | complete_test.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/complete_test.go b/complete_test.go index 0079c30..ee5a133 100644 --- a/complete_test.go +++ b/complete_test.go @@ -13,20 +13,20 @@ func TestCompleter_Complete(t *testing.T) { c := Command{ Sub: map[string]Command{ "sub1": { - Flags: map[string]Predicate{ + Flags: map[string]Predictor{ "-flag1": PredictAnything, "-flag2": PredictNothing, }, }, "sub2": { - Flags: map[string]Predicate{ + Flags: map[string]Predictor{ "-flag2": PredictNothing, "-flag3": PredictSet("opt1", "opt2", "opt12"), }, - Args: Predicate(PredictDirs("*")).Or(PredictFiles("*.md")), + Args: PredictOr(PredictDirs("*"), PredictFiles("*.md")), }, }, - Flags: map[string]Predicate{ + Flags: map[string]Predictor{ "-h": PredictNothing, "-global1": PredictAnything, "-o": PredictFiles("*.txt"), @@ -176,7 +176,7 @@ func TestCompleter_Complete(t *testing.T) { os.Setenv(envComplete, tt.args) line, _ := getLine() - got := complete(c, newArgs(line)) + got := c.Predict(newArgs(line)) sort.Strings(tt.want) sort.Strings(got) |
