Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions .github/workflows/test-and-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
lua: [lua=5.1, lua=5.2, lua=5.3, lua=5.4, luajit=@v2.0, luajit=@v2.1]
steps:
Expand All @@ -19,6 +20,13 @@ jobs:
- name: Install libreadline
run: sudo apt-get install -y libreadline-dev

- name: Cache Restore
uses: actions/cache/restore@v5
with:
path: |
lua_install
key: ${{ matrix.lua }}-lua_install

- name: Install Lua (${{ matrix.lua }})
run: |
pip install git+https://github.com/luarocks/hererocks
Expand All @@ -27,14 +35,20 @@ jobs:

- name: Install depedencies
run: |
luarocks install busted
luarocks install tested
luarocks install lua-cjson
luarocks install luacov
luarocks install luacov-coveralls

- name: Run unit tests with coverage
run: busted --verbose --coverage

run: tested -c

- name: Save Cache
uses: actions/cache/save@v5
with:
path: |
lua_install
key: ${{ matrix.lua }}-lua_install

- name: Report test coverage
if: success()
continue-on-error: true
Expand Down
Empty file added tests/bad_csvs/empty_file.csv
Empty file.
1 change: 1 addition & 0 deletions tests/bad_csvs/empty_file_newline.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

2 changes: 2 additions & 0 deletions tests/bad_csvs/empty_header.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
a,b,
herp,derp
3 changes: 3 additions & 0 deletions tests/bad_csvs/too_few_cols.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
a,b,c
failing,hard
man,oh,well...
3 changes: 3 additions & 0 deletions tests/bad_csvs/too_few_cols_end.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
a,b,c
man,oh,well...
failing,hard
3 changes: 3 additions & 0 deletions tests/bad_csvs/too_many_cols.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
a,b,c
no,one,knows
what,am,i,doing?
1 change: 1 addition & 0 deletions tests/csvs/bom-os9.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a,b,c1,2,34,5,ʤ
Expand Down
2 changes: 2 additions & 0 deletions tests/csvs/comma_in_quotes.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
first,last,address,city,zip
John,Doe,120 any st.,"Anytown, WW",08123
7 changes: 7 additions & 0 deletions tests/csvs/correctness.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Year,Make,Model,Description,Price
1997,Ford,E350,"ac, abs, moon",3000.00
1999,Chevy,"Venture ""Extended Edition""","",4900.00
1996,Jeep,Grand Cherokee,"MUST SELL!
air, moon roof, loaded",4799.00
1999,Chevy,"Venture ""Extended Edition, Very Large""",,5000.00
,,"Venture ""Extended Edition""","",4900.00
3 changes: 3 additions & 0 deletions tests/csvs/empty.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
a,b,c
1,"",""
2,3,4
3 changes: 3 additions & 0 deletions tests/csvs/empty_crlf.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
a,b,c
1,"",""
2,3,4
2 changes: 2 additions & 0 deletions tests/csvs/empty_no_newline.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
a,b,c
1,"",""
2 changes: 2 additions & 0 deletions tests/csvs/empty_no_quotes.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
a,b,c
1,,
3 changes: 3 additions & 0 deletions tests/csvs/escaped_quotes.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
a,b
1,"ha ""ha"" ha"
3,4
3 changes: 3 additions & 0 deletions tests/csvs/escaped_quotes_in_header.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"li""on",tiger,"be""ar"
1,2,3
5,6,7
2 changes: 2 additions & 0 deletions tests/csvs/json.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
key,val
1,"{""type"": ""Point"", ""coordinates"": [102.0, 0.5]}"
2 changes: 2 additions & 0 deletions tests/csvs/json_no_newline.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
key,val
1,"{""type"": ""Point"", ""coordinates"": [102.0, 0.5]}"
4 changes: 4 additions & 0 deletions tests/csvs/missing_keys.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
a,b,c
1,2,3
10,20,
100,,300
5 changes: 5 additions & 0 deletions tests/csvs/newlines.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
a,b,c
1,2,3
"Once upon
a time",5,6
7,8,9
5 changes: 5 additions & 0 deletions tests/csvs/newlines_crlf.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
a,b,c
1,2,3
"Once upon
a time",5,6
7,8,9
1 change: 1 addition & 0 deletions tests/csvs/os9.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a,b,c1,2,34,5,ʤ
Expand Down
5 changes: 5 additions & 0 deletions tests/csvs/quotes_and_newlines.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
a,b
1,"ha
""ha""
ha"
3,4
2 changes: 2 additions & 0 deletions tests/csvs/quotes_non_escaped.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"Country","City","AccentCity","Region"
af,dekh"iykh'ya,Dekh"iykh'ya,13
2 changes: 2 additions & 0 deletions tests/csvs/simple.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
a,b,c
1,2,3
2 changes: 2 additions & 0 deletions tests/csvs/simple_crlf.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
a,b,c
1,2,3
3 changes: 3 additions & 0 deletions tests/csvs/utf8.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
a,b,c
1,2,3
4,5,ʤ
Loading
Loading