Merge pull request #190818 from IvarWithoutBones/testversion-doc

doc/testers: testVersion -> testers.testVersion, add example

authored by davidak and committed by GitHub 63f7b8c9 3dc04b3a

+11 -5
+11 -5
doc/builders/testers.chapter.md
··· 14 14 Examples: 15 15 16 16 ```nix 17 - passthru.tests.version = testVersion { package = hello; }; 17 + passthru.tests.version = testers.testVersion { package = hello; }; 18 18 19 - passthru.tests.version = testVersion { 19 + passthru.tests.version = testers.testVersion { 20 20 package = seaweedfs; 21 21 command = "weed version"; 22 22 }; 23 23 24 - passthru.tests.version = testVersion { 24 + passthru.tests.version = testers.testVersion { 25 25 package = key; 26 26 command = "KeY --help"; 27 27 # Wrong '2.5' version in the code. Drop on next version. 28 28 version = "2.5"; 29 29 }; 30 + 31 + passthru.tests.version = testers.testVersion { 32 + package = ghr; 33 + # The output needs to contain the 'version' string without any prefix or suffix. 34 + version = "v${version}"; 35 + }; 30 36 ``` 31 37 32 38 ## `testEqualDerivation` {#tester-testEqualDerivation} ··· 42 48 Example: 43 49 44 50 ```nix 45 - testEqualDerivation 51 + testers.testEqualDerivation 46 52 "The hello package must stay the same when enabling checks." 47 53 hello 48 54 (hello.overrideAttrs(o: { doCheck = true; })) ··· 73 79 Example: 74 80 75 81 ```nix 76 - tests.fetchgit = invalidateFetcherByDrvHash fetchgit { 82 + tests.fetchgit = testers.invalidateFetcherByDrvHash fetchgit { 77 83 name = "nix-source"; 78 84 url = "https://github.com/NixOS/nix"; 79 85 rev = "9d9dbe6ed05854e03811c361a3380e09183f4f4a";