-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 876a176
Showing
6 changed files
with
2,320 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Run Tests and Code Coverage | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
luaVersion: [lua=5.1, lua=5.2, lua=5.3, lua=5.4, luajit=2.0, [email protected]] | ||
steps: | ||
# Checks-out the repository under $GITHUB_WORKSPACE. | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: '>=1.19' | ||
|
||
- name: Install Lua (${{ matrix.lua }}) | ||
run: | | ||
pip install hererocks | ||
hererocks lua_install -r^ --${{ matrix.lua }} | ||
- name: Install toml-test | ||
run: go install github.com/toml-lang/toml-test/cmd/[email protected] | ||
|
||
- name: install depedencies | ||
run: | | ||
luarocks install lua-cjson | ||
luarocks install luacov | ||
luarocks install luacov-coveralls | ||
- name: run unit tests with coverage | ||
run: toml-test lua -llcov spec/test-runner.lua | ||
|
||
- name: Report test coverage | ||
if: success() | ||
continue-on-error: true | ||
run: luacov-coveralls -e .luarocks | ||
env: | ||
COVERALLS_REPO_TOKEN: ${{ github.token }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# tinytoml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
local cjson = require("cjson") | ||
local tinytoml = require("tinytoml") | ||
|
||
|
||
local assign_value_function = function(value, value_type) | ||
return { ["value"] = tostring(value), ["type"] = value_type } | ||
end | ||
|
||
print(cjson.encode(tinytoml.parse(io.read("*a"), { load_from_string = true, assign_value_function = assign_value_function }))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
local cjson = require("cjson") | ||
local tinytoml = require("tinytoml") | ||
|
||
-- the format toml-test expects | ||
local assign_value_function = function(value: any, value_type?: string): any | ||
return {["value"]=tostring(value), ["type"]=value_type} | ||
end | ||
|
||
print(cjson.encode(tinytoml.parse(io.read("*a"), {load_from_string=true, assign_value_function=assign_value_function}))) | ||
|
Oops, something went wrong.