(t *testing.T)
| 47 | } |
| 48 | |
| 49 | func TestLearnListRemove(t *testing.T) { |
| 50 | wb := SetupWorkbench(t) |
| 51 | defer wb.Close() |
| 52 | |
| 53 | shellPid := wb.LaunchFakeShell() |
| 54 | |
| 55 | wb.RunCodCmd("init", strconv.Itoa(shellPid), "bash") |
| 56 | |
| 57 | wb.RunCodCmd("learn", "--", "binaries/cat.py", "--help") |
| 58 | wb.RunCodCmd("learn", "--", "binaries/naval-fate.py", "--help") |
| 59 | |
| 60 | out := wb.RunCodCmd("list") |
| 61 | |
| 62 | commands := wb.ParseCodListCommands(out) |
| 63 | |
| 64 | require.Equal(t, |
| 65 | []string{ |
| 66 | "binaries/cat.py --help", |
| 67 | "binaries/naval-fate.py --help", |
| 68 | }, |
| 69 | commands, |
| 70 | ) |
| 71 | |
| 72 | wb.RunCodCmd("remove", "1") |
| 73 | out = wb.RunCodCmd("list") |
| 74 | commands = wb.ParseCodListCommands(out) |
| 75 | |
| 76 | require.Equal(t, |
| 77 | []string{ |
| 78 | "binaries/naval-fate.py --help", |
| 79 | }, |
| 80 | commands, |
| 81 | ) |
| 82 | |
| 83 | wb.RunCodCmd("remove", "2") |
| 84 | out = wb.RunCodCmd("list") |
| 85 | require.Equal(t, "", out) |
| 86 | } |
| 87 | |
| 88 | func TestLearnListBasenameSelector(t *testing.T) { |
| 89 | wb := SetupWorkbench(t) |
nothing calls this directly
no test coverage detected