Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add toml-test workflow #169

Merged
merged 16 commits into from
Nov 9, 2023
Merged
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
5 changes: 5 additions & 0 deletions .changeset/blue-cameras-roll.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"toml-eslint-parser": patch
---

fix: wrong value of `bigint` in binary `TOMLIntegerValue`
5 changes: 5 additions & 0 deletions .changeset/ten-paws-decide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"toml-eslint-parser": minor
---

refactor for getStaticTOMLValue
4 changes: 3 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
/coverage
/lib
/node_modules
/tests/fixtures/**/*.json
/tests/fixtures/**/*.json
!/.github
/toml-test-decode-last-result.json
18 changes: 9 additions & 9 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# These are supported funding model platforms

github: ota-meshi
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
patreon: null # Replace with a single Patreon username
open_collective: null # Replace with a single Open Collective username
ko_fi: null # Replace with a single Ko-fi username
tidelift: null # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: null # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: null # Replace with a single Liberapay username
issuehunt: null # Replace with a single IssueHunt username
otechie: null # Replace with a single Otechie username
custom: null # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
38 changes: 19 additions & 19 deletions .github/workflows/GHPages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,22 @@ jobs:
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-node@v4
- name: Install And Build
run: |+
npm install
npm run build
cd explorer
npm install
npm run build
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: ./explorer/dist
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-node@v4
- name: Install And Build
run: |+
npm install
npm run build
cd explorer
npm install
npm run build
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: ./explorer/dist
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
20 changes: 10 additions & 10 deletions .github/workflows/NewOldBenchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ jobs:
benchmark:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- name: Setup
run: npm run setup
- name: Install Packages
run: npm install -f
- name: Build
run: npm run build
- name: Benchmark
run: npm run benchmark
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- name: Setup
run: npm run setup
- name: Install Packages
run: npm install -f
- name: Build
run: npm run build
- name: Benchmark
run: npm run benchmark
34 changes: 17 additions & 17 deletions .github/workflows/NodeCI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,26 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- name: Install Packages
run: npm install -f
- name: Lint
run: npm run lint
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- name: Install Packages
run: npm install -f
- name: Lint
run: npm run lint
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x, 14.x, 16.x, 18.x, 20.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Setup
run: npm run setup
- name: Install Packages
run: npm install --legacy-peer-deps
- name: Test
run: npm test
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Setup
run: npm run setup
- name: Install Packages
run: npm install --legacy-peer-deps
- name: Test
run: npm test
33 changes: 33 additions & 0 deletions .github/workflows/toml-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: go toml-test

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install Go
uses: actions/setup-go@v2
- name: Setup Node.js
uses: actions/setup-node@v4
- name: Install zsh
run: sudo apt-get update; sudo apt-get install zsh
- name: Setup
run: npm run setup
- name: Install Packages
run: npm install -f
- name: Build
run: npm run build
- name: Install toml-test
run: go install -v github.com/toml-lang/toml-test/cmd/toml-test@latest
- name: Test
run: |
export PATH="$(go env GOPATH)/bin:$PATH"
./run-toml-test.zsh
shell: zsh {0}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,5 @@ dist
# TernJS port file
.tern-port

/lib
/lib
/toml-test-decode-last-result.json
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"typescript",
"json",
"jsonc",
"yaml"
"yaml",
"github-actions-workflow",
],
"typescript.validate.enable": true,
"javascript.validate.enable": false,
Expand Down
23 changes: 23 additions & 0 deletions run-toml-test.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env zsh
#
# Requires toml-test from https://github.com/toml-lang/toml-test

skip=(
# Invalid UTF-8 strings are not rejected
-skip='invalid/encoding/bad-utf8-*'

# Certain invalid UTF-8 codepoints are not rejected
-skip='invalid/encoding/bad-codepoint'

# Certain invalid newline codepoints are not rejected
-skip='invalid/control/rawmulti-cd'
-skip='invalid/control/multi-cr'
-skip='invalid/control/bare-cr'

# Debug
# -run 'valid/table/with-single-quotes'
)

e=0
toml-test ${skip[@]} ./toml-test-decode.js || e=1
exit $e
2 changes: 1 addition & 1 deletion src/tokenizer/tokenizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const RADIX_PREFIXES = {
16: "0x",
10: "",
8: "0o",
2: "02",
2: "0b",
};

const ESCAPES_1_0: Record<number, string> = {
Expand Down
Loading
Loading