Skip to content

Commit

Permalink
lint files
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnyadn committed Oct 14, 2023
1 parent 679d997 commit a5af6f6
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 27 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ name: CI

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

jobs:
build:
strategy:
matrix:
os: [ ubuntu-latest, windows-latest ]
os: [ubuntu-latest, windows-latest]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

runs-on: ${{ matrix.os }}
Expand Down
16 changes: 11 additions & 5 deletions test/inlineTable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ it('should support empty inline tables', () => {
const input = 'a = {}';
const result = load(input);

expect(result).toEqual({a: {}});
expect(result).toEqual({ a: {} });
});

it('should support all value types in inline tables', () => {
Expand All @@ -31,7 +31,7 @@ it('should support all value types in inline tables', () => {
d: true,
e: new Date(Date.UTC(1979, 4, 27, 7, 32, 0)),
f: [1, 2, 3],
g: {h: 4},
g: { h: 4 },
},
});
});
Expand All @@ -54,7 +54,7 @@ line
string""" }`;
const result = load(input);

expect(result).toEqual({a: {b: 'multi\nline\nstring'}});
expect(result).toEqual({ a: { b: 'multi\nline\nstring' } });
});

it('should throw error if adding keys outside the inline table', () => {
Expand All @@ -76,8 +76,14 @@ it('should support use inline tables as values in arrays', () => {
const input = `points = [ { x = 1, y = 2, z = 3 },
{ x = 7, y = 8, z = 9 },
{ x = 2, y = 4, z = 8 } ]
`
`;
const result = load(input);

expect(result).toEqual({points: [{x: 1, y: 2, z: 3}, {x: 7, y: 8, z: 9}, {x: 2, y: 4, z: 8}]});
expect(result).toEqual({
points: [
{ x: 1, y: 2, z: 3 },
{ x: 7, y: 8, z: 9 },
{ x: 2, y: 4, z: 8 },
],
});
});
10 changes: 1 addition & 9 deletions testcase/valid/array/empty.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
{
"thevoid": [
[
[
[
[]
]
]
]
]
"thevoid": [[[[[]]]]]
}
6 changes: 1 addition & 5 deletions testcase/valid/inline-table/empty.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@
}
}
],
"many_empty": [
{},
{},
{}
],
"many_empty": [{}, {}, {}],
"nested_empty": {
"empty": {}
}
Expand Down
6 changes: 1 addition & 5 deletions testcase/valid/inline-table/nest.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
{
"arr_arr_tbl_empty": [
[
{}
]
],
"arr_arr_tbl_empty": [[{}]],
"arr_arr_tbl_val": [
[
{
Expand Down

0 comments on commit a5af6f6

Please sign in to comment.