diff options
| author | Eyal Posener <[email protected]> | 2017-05-11 20:54:26 +0300 |
|---|---|---|
| committer | GitHub <[email protected]> | 2017-05-11 20:54:26 +0300 |
| commit | d3bbb859d52b45987e3cd2098e28423f32edd999 (patch) | |
| tree | 4265893d0c665ba0e763482a70c9044fa983a1ed /complete_test.go | |
| parent | dd2171d085ef5957a1c5c0794d6007822e47849b (diff) | |
| parent | ba23c350c73d2dfdf071c14c22152bcaf7e7fd7b (diff) | |
Merge pull request #12 from posener/improves
Enhance program structure and data structures
Diffstat (limited to 'complete_test.go')
| -rw-r--r-- | complete_test.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/complete_test.go b/complete_test.go index 282a2f6..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"), @@ -174,9 +174,9 @@ func TestCompleter_Complete(t *testing.T) { tt.args = "cmd " + tt.args os.Setenv(envComplete, tt.args) - args, _ := getLine() + line, _ := getLine() - got := complete(c, args) + got := c.Predict(newArgs(line)) sort.Strings(tt.want) sort.Strings(got) |
