-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix old tests and add new for customize mode
- Loading branch information
Showing
20 changed files
with
204 additions
and
105 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
cli/tests/snapshot/inputs/customize-mode/assignment_syntax_error.ncl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# capture = 'stderr' | ||
# command = ['export'] | ||
# extra_args = [ | ||
# '--', | ||
# 'input.foo.bar=="hello"', | ||
# 'input.foo.baz=[]', | ||
# '--override', | ||
# 'unkonwn.field.path=null', | ||
# ] | ||
{ | ||
input.foo.bar | String, | ||
input.foo.baz | Array Number, | ||
input.defaulted.subfield | ||
| doc "Some documentation" | ||
| default = 2, | ||
|
||
override.first = 1, | ||
override.second = { | ||
subsecond = { | ||
subsubsecond = "a", | ||
other = [], | ||
} | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
cli/tests/snapshot/inputs/customize-mode/field_path_syntax_error.ncl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# capture = 'stderr' | ||
# command = ['export'] | ||
# extra_args = [ | ||
# '--', | ||
# 'show', | ||
# 'input.+foo.baz', | ||
# ] | ||
{ | ||
input.foo.bar | String, | ||
input.foo.baz | Array Number, | ||
input.defaulted.subfield | ||
| doc "Some documentation" | ||
| default = 2, | ||
|
||
override.first = 1, | ||
override.second = { | ||
subsecond = { | ||
subsubsecond = "a", | ||
other = [], | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# capture = 'stdout' | ||
# command = ['export'] | ||
# extra_args = ['--', 'list'] | ||
{ | ||
input.foo.bar | String, | ||
input.foo.baz | Array Number, | ||
input.defaulted.subfield | ||
| doc "Some documentation" | ||
| default = 2, | ||
|
||
override.first = 1, | ||
override.second = { | ||
subsecond = { | ||
subsubsecond = "a", | ||
other = [], | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# capture = 'stdout' | ||
# command = ['export'] | ||
# extra_args = ['--', 'show', 'input.defaulted.subfield'] | ||
{ | ||
input.foo.bar | String, | ||
input.foo.baz | Array Number, | ||
input.defaulted.subfield | ||
| std.number.Integer | ||
| doc "Some documentation" | ||
| default = 2, | ||
|
||
override.first = 1, | ||
override.second = { | ||
subsecond = { | ||
subsubsecond = "a", | ||
other = [], | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
cli/tests/snapshot/inputs/customize-mode/unkonwn_field_path.ncl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# capture = 'stderr' | ||
# command = ['export'] | ||
# extra_args = [ | ||
# '--', | ||
# 'show', | ||
# 'unkonwn.field.path', | ||
# ] | ||
{ | ||
input.foo.bar | String, | ||
input.foo.baz | Array Number, | ||
input.defaulted.subfield | ||
| doc "Some documentation" | ||
| default = 2, | ||
|
||
override.first = 1, | ||
override.second = { | ||
subsecond = { | ||
subsubsecond = "a", | ||
other = [], | ||
} | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
cli/tests/snapshot/snapshots/snapshot__export_stderr_assignment_syntax_error.ncl.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
source: cli/tests/snapshot/main.rs | ||
expression: err | ||
--- | ||
error: unexpected token | ||
┌─ <cli-assignment>:1:14 | ||
│ | ||
1 │ input.foo.bar=="hello" | ||
│ ^^ | ||
|
||
note: when parsing a field assignment on the command line | ||
= A field assignment must be of the form `<field path>=<value>`, where `<field path>` is a dot-separated list of fields and `<value>` is a valid Nickel expression. | ||
= For example: `config.database."$port"=8080` | ||
|
||
|
15 changes: 15 additions & 0 deletions
15
cli/tests/snapshot/snapshots/snapshot__export_stderr_field_path_syntax_error.ncl.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
source: cli/tests/snapshot/main.rs | ||
expression: err | ||
--- | ||
error: unexpected token | ||
┌─ <query>:1:7 | ||
│ | ||
1 │ input.+foo.baz | ||
│ ^ | ||
|
||
note: when parsing a field path on the command line | ||
= A field path must be a dot-separated list of fields. Fields with spaces or special characters must be properly quoted. | ||
= For example: `config.database."$port"` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
cli/tests/snapshot/snapshots/snapshot__export_stderr_unkonwn_field_path.ncl.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
source: cli/tests/snapshot/main.rs | ||
expression: err | ||
--- | ||
error: invalid query: unknown field `unkonwn.field.path` | ||
= `unkonwn.field.path` doesn't refer to record field accessible from the root of the configuration. | ||
|
||
|
28 changes: 0 additions & 28 deletions
28
cli/tests/snapshot/snapshots/snapshot__export_stdout_has_help.ncl.snap
This file was deleted.
Oops, something went wrong.
28 changes: 0 additions & 28 deletions
28
cli/tests/snapshot/snapshots/snapshot__export_stdout_has_override.ncl.snap
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
cli/tests/snapshot/snapshots/snapshot__export_stdout_list.ncl.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
source: cli/tests/snapshot/main.rs | ||
expression: out | ||
--- | ||
Input fields: | ||
- input.defaulted.subfield | ||
- input.foo.bar: <String> | ||
- input.foo.baz: <Array Number> | ||
|
||
Overridable fields (require `--override`): | ||
- override.first | ||
- override.second.subsecond.other | ||
- override.second.subsecond.subsubsecond | ||
|
9 changes: 9 additions & 0 deletions
9
cli/tests/snapshot/snapshots/snapshot__export_stdout_show.ncl.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
source: cli/tests/snapshot/main.rs | ||
expression: out | ||
--- | ||
[38;5;240m•[39m [1mcontract[0m: [3mstd.number.Integer[0m | ||
[38;5;240m•[39m [1mdefault[0m: [3m2[0m | ||
[38;5;240m•[39m [1mdocumentation[0m: Some documentation | ||
|
||
|