1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 18:31:49 +02:00

test: Fix shifted source positions after formatting

This commit is contained in:
Robert Hensing 2025-01-24 22:21:27 +01:00
parent 32aed360b8
commit f629d81df0
44 changed files with 400 additions and 385 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

@ -20,7 +20,7 @@ Look, it's just like a function!
nix-repl> :doc recursive
Function `__functor`\
… defined at /path/to/tests/functional/repl/doc-functor.nix:77:23
… defined at /path/to/tests/functional/repl/doc-functor.nix:82:23
This looks bad, but the docs are ok because of the eta expansion.
@ -30,27 +30,27 @@ error:
… while partially calling '__functor' to retrieve documentation
… while calling '__functor'
at /path/to/tests/functional/repl/doc-functor.nix:85:17:
84| */
85| __functor = self: self.__functor self;
at /path/to/tests/functional/repl/doc-functor.nix:90:17:
89| */
90| __functor = self: self.__functor self;
| ^
86| };
91| };
… from call site
at /path/to/tests/functional/repl/doc-functor.nix:85:23:
84| */
85| __functor = self: self.__functor self;
at /path/to/tests/functional/repl/doc-functor.nix:90:23:
89| */
90| __functor = self: self.__functor self;
| ^
86| };
91| };
(19999 duplicate frames omitted)
error: stack overflow; max-call-depth exceeded
at /path/to/tests/functional/repl/doc-functor.nix:85:23:
84| */
85| __functor = self: self.__functor self;
at /path/to/tests/functional/repl/doc-functor.nix:90:23:
89| */
90| __functor = self: self.__functor self;
| ^
86| };
91| };
nix-repl> :doc diverging
error:
@ -59,18 +59,18 @@ error:
(10000 duplicate frames omitted)
… while calling '__functor'
at /path/to/tests/functional/repl/doc-functor.nix:97:19:
96| f = x: {
97| __functor = self: (f (x + 1));
| ^
98| };
at /path/to/tests/functional/repl/doc-functor.nix:103:21:
102| f = x: {
103| __functor = self: (f (x + 1));
| ^
104| };
error: stack overflow; max-call-depth exceeded
at /path/to/tests/functional/repl/doc-functor.nix:97:26:
96| f = x: {
97| __functor = self: (f (x + 1));
| ^
98| };
at /path/to/tests/functional/repl/doc-functor.nix:103:28:
102| f = x: {
103| __functor = self: (f (x + 1));
| ^
104| };
nix-repl> :doc helper
Function `square`\
@ -81,21 +81,21 @@ Compute x^2
nix-repl> :doc helper2
Function `__functor`\
… defined at /path/to/tests/functional/repl/doc-functor.nix:45:23
… defined at /path/to/tests/functional/repl/doc-functor.nix:46:13
This is a function that can be overridden.
nix-repl> :doc lib.helper3
Function `__functor`\
… defined at /path/to/tests/functional/repl/doc-functor.nix:45:23
… defined at /path/to/tests/functional/repl/doc-functor.nix:46:13
This is a function that can be overridden.
nix-repl> :doc helper3
Function `__functor`\
… defined at /path/to/tests/functional/repl/doc-functor.nix:45:23
… defined at /path/to/tests/functional/repl/doc-functor.nix:46:13
This is a function that can be overridden.

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