1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-30 11:43:15 +02:00

test: Fix shifted source positions after formatting

This commit is contained in:
Robert Hensing 2025-01-24 21:32:07 +01:00
parent 2f1b70a529
commit ae0bb7d71c
39 changed files with 332 additions and 319 deletions

View file

@ -6,7 +6,8 @@ Added <number omitted> variables.
nix-repl> :doc curriedArgs
Function `curriedArgs`\
… defined at /path/to/tests/functional/repl/doc-comments.nix:48:5
… defined at /path/to/tests/functional/repl/doc-comments.nix:87:5
A documented function.
@ -17,7 +18,8 @@ nix-repl> "Note that users may not expect this to behave as it currently does"
nix-repl> :doc x
Function `curriedArgs`\
… defined at /path/to/tests/functional/repl/doc-comments.nix:50:5
… defined at /path/to/tests/functional/repl/doc-comments.nix:91:5
The function returned by applying once

View file

@ -9,6 +9,7 @@ nix-repl> "Note that this is not yet complete"
nix-repl> :doc documentedFormals
Function `documentedFormals`\
… defined at /path/to/tests/functional/repl/doc-comments.nix:57:5
… defined at /path/to/tests/functional/repl/doc-comments.nix:104:5
Finds x

View file

@ -2,6 +2,7 @@ Nix <nix version>
Type :? for help.
nix-repl> :doc import ./doc-comment-function.nix
Function defined at /path/to/tests/functional/repl/doc-comment-function.nix:2:1
Function defined at /path/to/tests/functional/repl/doc-comment-function.nix:4:1
A doc comment for a file that only contains a function

View file

@ -6,6 +6,7 @@ Added <number omitted> variables.
nix-repl> :doc compact
Function `compact`\
… defined at /path/to/tests/functional/repl/doc-comments.nix:18:20
… defined at /path/to/tests/functional/repl/doc-comments.nix:27:5
boom

View file

@ -10,25 +10,27 @@ error: value does not have documentation
nix-repl> :doc lib.version
Attribute `version`
… defined at /path/to/tests/functional/repl/doc-comments.nix:30:3
… defined at /path/to/tests/functional/repl/doc-comments.nix:47:3
Immovably fixed.
nix-repl> :doc lib.attr.empty
Attribute `empty`
… defined at /path/to/tests/functional/repl/doc-comments.nix:33:3
… defined at /path/to/tests/functional/repl/doc-comments.nix:52:3
Unchangeably constant.
nix-repl> :doc lib.attr.undocument
error:
… while evaluating the attribute 'attr.undocument'
at /path/to/tests/functional/repl/doc-comments.nix:33:3:
32| /** Unchangeably constant. */
33| lib.attr.empty = { };
at /path/to/tests/functional/repl/doc-comments.nix:52:3:
51| */
52| lib.attr.empty = { };
| ^
34|
53|
error: attribute 'undocument' missing
at «string»:1:1:
@ -39,28 +41,31 @@ error:
nix-repl> :doc (import ./doc-comments.nix).constant
Attribute `constant`
… defined at /path/to/tests/functional/repl/doc-comments.nix:27:3
… defined at /path/to/tests/functional/repl/doc-comments.nix:42:3
Firmly rigid.
nix-repl> :doc (import ./doc-comments.nix).lib.version
Attribute `version`
… defined at /path/to/tests/functional/repl/doc-comments.nix:30:3
… defined at /path/to/tests/functional/repl/doc-comments.nix:47:3
Immovably fixed.
nix-repl> :doc (import ./doc-comments.nix).lib.attr.empty
Attribute `empty`
… defined at /path/to/tests/functional/repl/doc-comments.nix:33:3
… defined at /path/to/tests/functional/repl/doc-comments.nix:52:3
Unchangeably constant.
nix-repl> :doc (import ./doc-comments.nix).lib.attr.undocumented
Attribute `undocumented`
… defined at /path/to/tests/functional/repl/doc-comments.nix:35:3
… defined at /path/to/tests/functional/repl/doc-comments.nix:54:3
No documentation found.
@ -97,11 +102,11 @@ error: attribute 'missing' missing
nix-repl> :doc lib.attr.undocumental
error:
… while evaluating the attribute 'attr.undocumental'
at /path/to/tests/functional/repl/doc-comments.nix:33:3:
32| /** Unchangeably constant. */
33| lib.attr.empty = { };
at /path/to/tests/functional/repl/doc-comments.nix:52:3:
51| */
52| lib.attr.empty = { };
| ^
34|
53|
error: attribute 'undocumental' missing
at «string»:1:1:

View file

@ -6,6 +6,7 @@ Added <number omitted> variables.
nix-repl> :doc floatedIn
Function `floatedIn`\
… defined at /path/to/tests/functional/repl/doc-comments.nix:16:5
… defined at /path/to/tests/functional/repl/doc-comments.nix:21:5
This also works.

View file

@ -6,24 +6,28 @@ Added <number omitted> variables.
nix-repl> :doc nonStrict
Function `nonStrict`\
… defined at /path/to/tests/functional/repl/doc-comments.nix:37:70
… defined at /path/to/tests/functional/repl/doc-comments.nix:60:5
My syntax is not strict, but I'm strict anyway.
nix-repl> :doc strict
Function `strict`\
… defined at /path/to/tests/functional/repl/doc-comments.nix:38:63
… defined at /path/to/tests/functional/repl/doc-comments.nix:65:5
I don't have to be strict, but I am anyway.
nix-repl> :doc strictPre
Function `strictPre`\
… defined at /path/to/tests/functional/repl/doc-comments.nix:40:48
… defined at /path/to/tests/functional/repl/doc-comments.nix:71:5
Here's one way to do this
nix-repl> :doc strictPost
Function `strictPost`\
… defined at /path/to/tests/functional/repl/doc-comments.nix:41:53
… defined at /path/to/tests/functional/repl/doc-comments.nix:76:5
Here's another way to do this

View file

@ -6,6 +6,7 @@ Added <number omitted> variables.
nix-repl> :doc measurement
Function `measurement`\
… defined at /path/to/tests/functional/repl/doc-comments.nix:13:17
… defined at /path/to/tests/functional/repl/doc-comments.nix:15:17
👈 precisely this wide 👉

View file

@ -6,6 +6,7 @@ Added <number omitted> variables.
nix-repl> :doc unambiguous
Function `unambiguous`\
… defined at /path/to/tests/functional/repl/doc-comments.nix:24:5
… defined at /path/to/tests/functional/repl/doc-comments.nix:37:5
Very close