about summary refs log tree commit diff
path: root/doc/builders
diff options
context:
space:
mode:
authorIvar Scholten <ivar.scholten@protonmail.com>2022-09-11 19:50:54 +0200
committerIvar Scholten <ivar.scholten@protonmail.com>2022-09-15 22:46:37 +0200
commit6c40872147f3159634e7c9db64229e9ae1f76090 (patch)
treec9eab32f9a50040b8462b5e75b316a0216dd5ad2 /doc/builders
parent2eafac6d06ae28b8fa92c7121352450e9fd80000 (diff)
doc/testers: testVersion -> testers.testVersion, add example
Diffstat (limited to 'doc/builders')
-rw-r--r--doc/builders/testers.chapter.md16
1 files changed, 11 insertions, 5 deletions
diff --git a/doc/builders/testers.chapter.md b/doc/builders/testers.chapter.md
index c6fb71de01807..ad1e1036d5086 100644
--- a/doc/builders/testers.chapter.md
+++ b/doc/builders/testers.chapter.md
@@ -14,19 +14,25 @@ for example when using an 'old' hash in a fixed-output derivation.
 Examples:
 
 ```nix
-passthru.tests.version = testVersion { package = hello; };
+passthru.tests.version = testers.testVersion { package = hello; };
 
-passthru.tests.version = testVersion {
+passthru.tests.version = testers.testVersion {
   package = seaweedfs;
   command = "weed version";
 };
 
-passthru.tests.version = testVersion {
+passthru.tests.version = testers.testVersion {
   package = key;
   command = "KeY --help";
   # Wrong '2.5' version in the code. Drop on next version.
   version = "2.5";
 };
+
+passthru.tests.version = testers.testVersion {
+  package = ghr;
+  # The output needs to contain the 'version' string without any prefix or suffix.
+  version = "v${version}";
+};
 ```
 
 ## `testEqualDerivation` {#tester-testEqualDerivation}
@@ -42,7 +48,7 @@ Otherwise, the build log explains the difference via `nix-diff`.
 Example:
 
 ```nix
-testEqualDerivation
+testers.testEqualDerivation
   "The hello package must stay the same when enabling checks."
   hello
   (hello.overrideAttrs(o: { doCheck = true; }))
@@ -73,7 +79,7 @@ fixed output derivation.
 Example:
 
 ```nix
-tests.fetchgit = invalidateFetcherByDrvHash fetchgit {
+tests.fetchgit = testers.invalidateFetcherByDrvHash fetchgit {
   name = "nix-source";
   url = "https://github.com/NixOS/nix";
   rev = "9d9dbe6ed05854e03811c361a3380e09183f4f4a";