@@ -38,24 +38,24 @@ func (this *ScanAllFixture) scanAll(inputs []string, options ...Option) (scanned
38
38
}
39
39
40
40
func (this * ScanAllFixture ) TestCanonical () {
41
- scanned := this .scanAll (csvCanon , Comma (',' ), FieldsPerRecord (3 ))
41
+ scanned := this .scanAll (csvCanon , Options . Comma (',' ), Options . FieldsPerRecord (3 ))
42
42
this .So (scanned , should .Resemble , expectedScannedOutput )
43
43
}
44
44
45
45
func (this * ScanAllFixture ) TestCanonicalWithOptions () {
46
- scanned := this .scanAll (csvCanonRequiringConfigOptions , Comma (';' ), Comment ('#' ))
46
+ scanned := this .scanAll (csvCanonRequiringConfigOptions , Options . Comma (';' ), Options . Comment ('#' ))
47
47
this .So (scanned , should .Resemble , expectedScannedOutput )
48
48
}
49
49
50
50
func (this * ScanAllFixture ) TestOptions () {
51
- scanner := NewScanner (nil , ReuseRecord (true ), TrimLeadingSpace (true ), LazyQuotes (true ))
51
+ scanner := NewScanner (nil , Options . ReuseRecord (true ), Options . TrimLeadingSpace (true ), Options . LazyQuotes (true ))
52
52
this .So (scanner .reader .ReuseRecord , should .BeTrue )
53
53
this .So (scanner .reader .LazyQuotes , should .BeTrue )
54
54
this .So (scanner .reader .TrimLeadingSpace , should .BeTrue )
55
55
}
56
56
57
57
func (this * ScanAllFixture ) TestInconsistentFieldCounts_ContinueOnError () {
58
- scanned := this .scanAll (csvCanonInconsistentFieldCounts , ContinueOnError (true ))
58
+ scanned := this .scanAll (csvCanonInconsistentFieldCounts , Options . ContinueOnError (true ))
59
59
this .So (scanned , should .Resemble , []Record {
60
60
{line : 1 , record : []string {"1" , "2" , "3" }, err : nil },
61
61
{line : 2 , record : []string {"1" , "2" , "3" , "4" }, err : & csv.ParseError {StartLine : 2 , Line : 2 , Column : 1 , Err : csv .ErrFieldCount }},
@@ -72,7 +72,7 @@ func (this *ScanAllFixture) TestInconsistentFieldCounts_HaltOnError() {
72
72
}
73
73
74
74
func (this * ScanAllFixture ) TestCallsToScanAfterEOFReturnFalse () {
75
- scanner := NewScanner (strings .NewReader ("1,2,3" ), Comma (',' ))
75
+ scanner := NewScanner (strings .NewReader ("1,2,3" ), Options . Comma (',' ))
76
76
77
77
this .So (scanner .Scan (), should .BeTrue )
78
78
this .So (scanner .Record (), should .Resemble , []string {"1" , "2" , "3" })
@@ -86,7 +86,7 @@ func (this *ScanAllFixture) TestCallsToScanAfterEOFReturnFalse() {
86
86
}
87
87
88
88
func (this * ScanAllFixture ) TestSkipHeader () {
89
- scanned := this .scanAll (csvCanon , Comma (',' ), SkipHeaderRecord ())
89
+ scanned := this .scanAll (csvCanon , Options . Comma (',' ), Options . SkipHeaderRecord ())
90
90
this .So (scanned , should .Resemble , []Record {
91
91
{line : 1 , record : []string {"Rob" , "Pike" , "rob" }},
92
92
{line : 2 , record : []string {"Ken" , "Thompson" , "ken" }},
@@ -95,7 +95,7 @@ func (this *ScanAllFixture) TestSkipHeader() {
95
95
}
96
96
97
97
func (this * ScanAllFixture ) TestRecords () {
98
- scanned := this .scanAll (csvCanon , Comma (',' ), SkipRecords (3 ))
98
+ scanned := this .scanAll (csvCanon , Options . Comma (',' ), Options . SkipRecords (3 ))
99
99
this .So (scanned , should .Resemble , []Record {
100
100
{line : 1 , record : []string {"Robert" , "Griesemer" , "gri" }},
101
101
})
0 commit comments