Commit graph

7 commits

Author SHA1 Message Date
John Ericson 30dcc19d1f Put functional tests in tests/functional
I think it is bad for these reasons when `tests/` contains a mix of
functional and integration tests

 - Concepts is harder to understand, the documentation makes a good
   unit vs functional vs integration distinction, but when the
   integration tests are just two subdirs within `tests/` this is not
   clear.

 - Source filtering in the `flake.nix` is more complex. We need to
   filter out some of the dirs from `tests/`, rather than simply pick
   the dirs we want and take all of them. This is a good sign the
   structure of what we are trying to do is not matching the structure
   of the files.

With this change we have a clean:
```shell-session
$ git show 'HEAD:tests'
tree HEAD:tests

functional/
installer/
nixos/
```

(cherry picked from commit 68c81c737571794f7246db53fb4774e94fcf4b7e)
2023-12-01 12:06:43 -05:00
Yorick 16f1720fd2
SourceExprCommand: swallow EvalError, add tests for this
Completing things that would error would print an ugly error in
the middle of your command line. Avoid printing this error.
2022-11-03 10:11:28 +01:00
Théophane Hufschmitt b052e7e71d Add some more completion tests
- Test another command than `build`
- Test with two input flakes
2022-07-13 10:31:17 +02:00
Théophane Hufschmitt d34a333e2e Fix the “out of order” completion test
`--override-input` id snarky because it takes two arguments, so it
doesn't play well when completed in the middle of the CLI (since the
argument just after gets interpreted as its second argument). So use
`--update-input` instead
2022-07-13 10:25:28 +02:00
Théophane Hufschmitt 21c443d4fd Test the tilde expansion for the flake completion
Also add a disabled test for when the `--override-input` flag comes
*before* the flake ref
2022-07-12 09:48:25 +02:00
Théophane Hufschmitt 07e14d3ef0 Harden the comparisons in the completion test
- Don't use `printf` for the expected result, but just use bash's `$' '`
  litteral strings
- Quote the `nix` call result
- Invert the order in the comparisons (just because it feels more
  natural)
2022-07-12 09:24:31 +02:00
Théophane Hufschmitt 32effccb51 Add some tests for the CLI completion 2022-07-12 09:24:31 +02:00