-
Notifications
You must be signed in to change notification settings - Fork 294
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pkg/path: use a subtest helper to test for each OS value
Using a subtest per OS helps so that "return" or "t.Skip" only affect the OS we're currently iterating on rather than all of them. This was already a problem with TestClean, whose t.Skip meant that we were only actually testing for os == Unix. A number of tests also conditionally appended to the test case list, such as appending extra Windows-only test cases when os == Windows. When doing that, append into a new local slice, as otherwise the append would also affect the next OS values. TestClean was broken once it tested all OS values as well; it modified some test case values when os == Windows, so make a copy of the test case slice first to ensure that's OK. While here, TestVolumeName only cares about Windows; simplify. Signed-off-by: Daniel Martí <[email protected]> Change-Id: I9ce635a3034153618a779dd31db030ae76ce5fdc Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1170044 Reviewed-by: Paul Jolly <[email protected]> Unity-Result: CUE porcuepine <[email protected]> TryBot-Result: CUEcueckoo <[email protected]>
- Loading branch information
Showing
2 changed files
with
40 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters