chore: fix tests

Signed-off-by: azjezz <azjezz@protonmail.com>
This commit is contained in:
azjezz 2022-12-07 09:01:54 +01:00
parent 3ae4555d81
commit 972fbfa046
No known key found for this signature in database
GPG Key ID: B00E0A46B3F1C157
4 changed files with 70 additions and 9 deletions

View File

@ -20,13 +20,13 @@ fix:
cargo clippy --fix --allow-dirty --allow-staged cargo clippy --fix --allow-dirty --allow-staged
# dump AST for the given file. # dump AST for the given file.
dump file: build dump file:
cargo run --bin php-parser-rs -- {{file}} cargo run --bin php-parser-rs -- {{file}}
# run all integration tests, except third-party. # run all integration tests, except third-party.
test filter='': build test filter='':
cargo test --all {{filter}} -- --skip third_party cargo test --all {{filter}} -- --skip third_party
# run integration tests for third-party libraries. # run integration tests for third-party libraries.
test-third-party: build test-third-party:
cargo test third_party cargo test third_party -- --nocapture

View File

@ -1337,11 +1337,6 @@ impl Lexer {
| [b'e' | b'E', b'0'..=b'9', ..] | [b'e' | b'E', b'0'..=b'9', ..]
); );
if !is_float { if !is_float {
let base = if kind == NumberKind::OctalOrFloat {
8
} else {
10
};
return parse_int(&buffer); return parse_int(&buffer);
} }

18
tests/fixtures/0268/ast.txt vendored Normal file
View File

@ -0,0 +1,18 @@
[
While {
condition: Variable(
Variable {
start: (
3,
8,
),
name: "foo",
end: (
3,
12,
),
},
),
body: [],
},
]

48
tests/fixtures/0268/tokens.txt vendored Normal file
View File

@ -0,0 +1,48 @@
[
Token {
kind: OpenTag(
Full,
),
span: (
1,
1,
),
},
Token {
kind: While,
span: (
3,
1,
),
},
Token {
kind: LeftParen,
span: (
3,
7,
),
},
Token {
kind: Variable(
"foo",
),
span: (
3,
8,
),
},
Token {
kind: RightParen,
span: (
3,
12,
),
},
Token {
kind: SemiColon,
span: (
3,
13,
),
},
]