Skip to content

Commit 96a80fc

Browse files
beldenonsi
authored andcommitted
Add test case for proper csv escaping
I generated the _test.go.{csv,json} files by using a version of ginkgo built from the next commit. If tests are run on this sha, they are expected to fail; the next commit fixes them.
1 parent 43dad69 commit 96a80fc

5 files changed

+24
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package example_test
2+
3+
import (
4+
. "github.com/onsi/ginkgo/v2"
5+
)
6+
7+
var _ = Describe("Abnormal\"Fixture", func() {
8+
When("four random words: flown, authenticating, semiweekly, and overproduction", func() {
9+
It("has a dangling double-quote here: \"", func() {
10+
By("step 1")
11+
By("step 2")
12+
})
13+
})
14+
})
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Name,Text,Start,End,Spec,Focused,Pending,Labels
2+
Describe,"Abnormal""Fixture",73,300,false,false,false,
3+
When,"four random words: flown, authenticating, semiweekly, and overproduction",113,297,false,false,false,
4+
It,"has a dangling double-quote here: """,205,293,true,false,false,
5+
By,step 1,260,272,false,false,false,
6+
By,step 2,276,288,false,false,false,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[{"name":"Describe","text":"Abnormal\"Fixture","start":73,"end":300,"spec":false,"focused":false,"pending":false,"labels":[],"nodes":[{"name":"When","text":"four random words: flown, authenticating, semiweekly, and overproduction","start":113,"end":297,"spec":false,"focused":false,"pending":false,"labels":[],"nodes":[{"name":"It","text":"has a dangling double-quote here: \"","start":205,"end":293,"spec":true,"focused":false,"pending":false,"labels":[],"nodes":[{"name":"By","text":"step 1","start":260,"end":272,"spec":false,"focused":false,"pending":false,"labels":null,"nodes":[]},{"name":"By","text":"step 2","start":276,"end":288,"spec":false,"focused":false,"pending":false,"labels":null,"nodes":[]}]}]}]}]
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
Name,Text,Start,End,Spec,Focused,Pending,Labels
2-
Describe,104,240,104,240,false,false,false,""
3-
It,209,236,209,236,true,false,false,""
2+
Describe,"104,240",104,240,false,false,false,
3+
It,"209,236",209,236,true,false,false,

ginkgo/outline/outline_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ var _ = DescribeTable("Validate outline from file with",
6565
Entry("core dsl import", "dsl_core_test.go", "dsl_core_test.go.json", "dsl_core_test.go.csv"),
6666
Entry("labels decorator on containers and specs", "labels_test.go", "labels_test.go.json", "labels_test.go.csv"),
6767
Entry("pending decorator on containers and specs", "pending_decorator_test.go", "pending_decorator_test.go.json", "pending_decorator_test.go.csv"),
68+
Entry("proper csv escaping of all fields", "csv_proper_escaping_test.go", "csv_proper_escaping_test.go.json", "csv_proper_escaping_test.go.csv"),
6869
)
6970

7071
var _ = Describe("Validate position", func() {

0 commit comments

Comments
 (0)