Skip to content

Commit e16f1ba

Browse files
committed
test: add integration test for Quote
1 parent 19df238 commit e16f1ba

File tree

11 files changed

+16
-15
lines changed

11 files changed

+16
-15
lines changed

pkg/integration/tests/custom_commands/form_prompts.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ var FormPrompts = NewIntegrationTest(NewIntegrationTestArgs{
1717
{
1818
Key: "a",
1919
Context: "files",
20-
Command: `echo "{{.Form.FileContent}}" > {{.Form.FileName}}`,
20+
Command: `echo {{.Form.FileContent | Quote}} > {{.Form.FileName | Quote}}`,
2121
Prompts: []config.CustomCommandPrompt{
2222
{
2323
Key: "FileName",
@@ -37,7 +37,7 @@ var FormPrompts = NewIntegrationTest(NewIntegrationTestArgs{
3737
{
3838
Name: "bar",
3939
Description: "Bar",
40-
Value: "BAR",
40+
Value: `"BAR"`,
4141
},
4242
{
4343
Name: "baz",
@@ -67,7 +67,7 @@ var FormPrompts = NewIntegrationTest(NewIntegrationTestArgs{
6767

6868
assert.InPrompt()
6969
assert.MatchCurrentViewTitle(Equals("Enter a file name"))
70-
input.Type("myfile")
70+
input.Type("my file")
7171
input.Confirm()
7272

7373
assert.InMenu()
@@ -82,7 +82,7 @@ var FormPrompts = NewIntegrationTest(NewIntegrationTestArgs{
8282
input.Confirm()
8383

8484
assert.WorkingTreeFileCount(1)
85-
assert.MatchSelectedLine(Contains("myfile"))
86-
assert.MatchMainViewContent(Contains("BAR"))
85+
assert.MatchSelectedLine(Contains("my file"))
86+
assert.MatchMainViewContent(Contains(`"BAR"`))
8787
},
8888
})

test/integration_new/custom_commands/form_prompts/expected/repo/.git_keep/commit-template.txt

Whitespace-only changes.

test/integration_new/custom_commands/form_prompts/expected/repo/.git_keep/config

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
filemode = true
44
bare = false
55
logallrefupdates = true
6+
ignorecase = true
7+
precomposeunicode = true
68
[user]
79
810
name = CI
11+
[commit]
12+
gpgSign = false
Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +0,0 @@
1-
# git ls-files --others --exclude-from=.git/info/exclude
2-
# Lines that start with '#' are comments.
3-
# For a project mostly in C, the following would be a good set of
4-
# exclude patterns (uncomment them if you want to use them):
5-
# *.[oa]
6-
# *~
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0000000000000000000000000000000000000000 6cd61dc75eb17cf3e01d4d5f8f2b38a73ed9be90 CI <[email protected]> 1660591942 +0000 commit (initial): blah
1+
0000000000000000000000000000000000000000 4687e94a43ed02b2ba08f3e6160ee22b92e64413 CI <[email protected]> 1664625021 +0900 commit (initial): blah
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0000000000000000000000000000000000000000 6cd61dc75eb17cf3e01d4d5f8f2b38a73ed9be90 CI <[email protected]> 1660591942 +0000 commit (initial): blah
1+
0000000000000000000000000000000000000000 4687e94a43ed02b2ba08f3e6160ee22b92e64413 CI <[email protected]> 1664625021 +0900 commit (initial): blah
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
x��1
2+
�0 @��>��B�UY�PB S�a9
3+
)ĸz��]?~i��;x~��a���R�������X׸H�W5���o�i��4�����ۣ�:�a���� �]��t��;���N��+�
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6cd61dc75eb17cf3e01d4d5f8f2b38a73ed9be90
1+
4687e94a43ed02b2ba08f3e6160ee22b92e64413
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"BAR"

0 commit comments

Comments
 (0)