You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Check the program version using a specified command and expected version string
58
+
59
+
This example will run the command `leetcode -V`, and then check that `leetcode 0.4.2` is in the output of the command as a whole word (separated by whitespaces).
60
+
This means that an output like "leetcode 0.4.21" would fail the tests, and an output like "You're running leetcode 0.4.2" would pass the tests.
61
+
62
+
A common usage of the `version` attribute is to specify `version = "v${version}"`.
63
+
64
+
```nix
65
+
version = "0.4.2";
57
66
58
67
passthru.tests.version = testers.testVersion {
59
-
package = ghr;
60
-
# The output needs to contain the 'version' string without any prefix or suffix.
61
-
version = "v${version}";
68
+
package = leetcode-cli;
69
+
command = "leetcode -V";
70
+
version = "leetcode ${version}";
62
71
};
63
72
```
64
73
74
+
:::
75
+
65
76
## `testBuildFailure` {#tester-testBuildFailure}
66
77
67
78
Make sure that a build does not succeed. This is useful for testing testers.
0 commit comments