Skip to content

Commit

Permalink
More delimiter guessing tests have been added
Browse files Browse the repository at this point in the history
  • Loading branch information
ws-garcia committed Jul 9, 2021
1 parent 43cae24 commit f88b5ac
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ VBA CSV interface is the most complete, and open source, CSV/TSV VBA parser libr

## Advantages
* __RFC-4180 specs compliant__.
* __Stable__. Fully Test Driven Developed (TDD) library, ([63/63 test passed](https://github.com/ws-garcia/VBA-CSV-interface/blob/master/testing/tests/results/)), that includes 650+ line of code for testing. See [VBA test library by Tim Hall](https://github.com/ws-garcia/vba-test).
* __Stable__. Fully Test Driven Developed (TDD) library, ([64/64 test passed](https://github.com/ws-garcia/VBA-CSV-interface/blob/master/testing/tests/results/)), that includes 650+ line of code for testing. See [VBA test library by Tim Hall](https://github.com/ws-garcia/vba-test).
* __Fast__. Writes and reads files at the highest speed.
* __Memory-friendly__. CSV/[TSV](https://www.iana.org/assignments/media-types/text/tab-separated-values) files are processed using a custom stream technique, only 0.5MB are in memory at a time.
* __Robust__. Parser and writer accept [Unix-style quotes escape sequences](https://www.loc.gov/preservation/digital/formats/fdd/fdd000323.shtml#notes).
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ VBA CSV interface is the most complete, and open source, CSV/TSV VBA parser libr

## Advantages
* __RFC-4180 specs compliant__.
* __Stable__. Fully Test Driven Developed (TDD) library, ([63/63 test passed](https://github.com/ws-garcia/VBA-CSV-interface/blob/master/testing/tests/results/)), that includes 650+ line of code for testing. See [VBA test library by Tim Hall](https://github.com/ws-garcia/vba-test).
* __Stable__. Fully Test Driven Developed (TDD) library, ([64/64 test passed](https://github.com/ws-garcia/VBA-CSV-interface/blob/master/testing/tests/results/)), that includes 650+ line of code for testing. See [VBA test library by Tim Hall](https://github.com/ws-garcia/vba-test).
* __Fast__. Writes and reads files at the highest speed.
* __Memory-friendly__. CSV/[TSV](https://www.iana.org/assignments/media-types/text/tab-separated-values) files are processed using a custom stream technique, only 0.5MB are in memory at a time.
* __Robust__. Parser and writer accept [Unix-style quotes escape sequences](https://www.loc.gov/preservation/digital/formats/fdd/fdd000323.shtml#notes).
Expand Down
13 changes: 13 additions & 0 deletions src/Tests/CSVDelimitersGuessingTESTS.bas
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,14 @@ Function DelimitersGuessingTests(FullFileName As String) As TestSuite
"Expected: (" & "[" & ExpectedResult(0) & "]" & " & " & "[" & ExpectedResult(2) & "]" & ")" & _
"Actual: (" & "[" & ActualResult(0) & "]" & " & " & "[" & ActualResult(2) & "]" & ")"
End With
'@--------------------------------------------------------------------------------
'Undefined field delimiter
With DelimitersGuessingTests.test("Undefined field delimiter")
UndefinedFieldDelimiter
.IsEqual ActualResult, ExpectedResult, _
"Expected: (" & "[" & ExpectedResult(0) & "]" & " & " & "[" & ExpectedResult(2) & "]" & ")" & _
"Actual: (" & "[" & ActualResult(0) & "]" & " & " & "[" & ActualResult(2) & "]" & ")"
End With
Set DelimitersGuessingTests = Nothing
End Function
Sub GetActualAndExpectedResults(FileName As String, _
Expand Down Expand Up @@ -267,6 +275,11 @@ Sub JsonDataType_clevercsvIssue37()

GetActualAndExpectedResults "Json data type - [clevercsv issue #37].csv", ",", vbLf, DoubleQuotes
End Sub
Sub UndefinedFieldDelimiter()
Set confObj = New parserConfig

GetActualAndExpectedResults "Undefined field delimiter.csv", ",", vbLf, DoubleQuotes
End Sub
'/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
'#

Expand Down
Binary file modified testing/tests/Test runner [CSVinterface-TDD].xlsm
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"This comma (,) need to be escaped"
This CSV has only one column
We will see if a semicolon (;) break the logic
or a single colon (:) or pipe (|)
Also include a Tab ( ) for testing
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
+ FEC data - [clevercsv issue #15]
+ Mixed comma and colon - [clevercsv issue #35]
+ Json data type - [clevercsv issue #37]
= PASS (13 of 13 passed) = 9/7/2021 9:59:10 a.�m. =
+ Undefined field delimiter
= PASS (14 of 14 passed) = 9/7/2021 6:27:43 p.�m. =

0 comments on commit f88b5ac

Please sign in to comment.