(t *testing.T)
| 24 | ) |
| 25 | |
| 26 | func TestExampleConfiguration(t *testing.T) { |
| 27 | wb := SetupWorkbench(t) |
| 28 | defer wb.Close() |
| 29 | |
| 30 | wb.RunCodCmd("example-config", "--create") |
| 31 | |
| 32 | _, err := wb.UncheckedRunCodCmd("example-config", "--create") |
| 33 | require.Error(t, err) |
| 34 | |
| 35 | shellPidInt := wb.LaunchFakeShell() |
| 36 | shellPid := strconv.Itoa(shellPidInt) |
| 37 | wb.RunCodCmd("init", shellPid, "bash") |
| 38 | wb.RunCodCmd("learn", "--", "binaries/cat.py", "--help") |
| 39 | out := wb.RunCodCmd("api", "complete-words", shellPid, "--", "1", "binaries/cat.py", "-") |
| 40 | |
| 41 | scan := bufio.NewScanner(strings.NewReader(out)) |
| 42 | var lines []string |
| 43 | for scan.Scan() { |
| 44 | lines = append(lines, scan.Text()) |
| 45 | } |
| 46 | require.Nil(t, scan.Err()) |
| 47 | |
| 48 | require.Equal(t, []string{ |
| 49 | "-A", |
| 50 | "--show-all", |
| 51 | "-b", |
| 52 | "--number-nonblank", |
| 53 | "-n", |
| 54 | "-e", |
| 55 | "-E", |
| 56 | "--show-ends", |
| 57 | "--number", |
| 58 | "-s", |
| 59 | "--squeeze-blank", |
| 60 | "-t", |
| 61 | "-T", |
| 62 | "--show-tabs", |
| 63 | "-u", |
| 64 | "-v", |
| 65 | "--show-nonprinting", |
| 66 | "--help", |
| 67 | "--version", |
| 68 | }, lines) |
| 69 | } |
nothing calls this directly
no test coverage detected