mirror of
https://github.com/danog/parser.git
synced 2024-11-26 20:04:57 +01:00
chore: fix tests
Signed-off-by: azjezz <azjezz@protonmail.com>
This commit is contained in:
parent
3ae4555d81
commit
972fbfa046
8
Justfile
8
Justfile
@ -20,13 +20,13 @@ fix:
|
||||
cargo clippy --fix --allow-dirty --allow-staged
|
||||
|
||||
# dump AST for the given file.
|
||||
dump file: build
|
||||
dump file:
|
||||
cargo run --bin php-parser-rs -- {{file}}
|
||||
|
||||
# run all integration tests, except third-party.
|
||||
test filter='': build
|
||||
test filter='':
|
||||
cargo test --all {{filter}} -- --skip third_party
|
||||
|
||||
# run integration tests for third-party libraries.
|
||||
test-third-party: build
|
||||
cargo test third_party
|
||||
test-third-party:
|
||||
cargo test third_party -- --nocapture
|
||||
|
@ -1337,11 +1337,6 @@ impl Lexer {
|
||||
| [b'e' | b'E', b'0'..=b'9', ..]
|
||||
);
|
||||
if !is_float {
|
||||
let base = if kind == NumberKind::OctalOrFloat {
|
||||
8
|
||||
} else {
|
||||
10
|
||||
};
|
||||
return parse_int(&buffer);
|
||||
}
|
||||
|
||||
|
18
tests/fixtures/0268/ast.txt
vendored
Normal file
18
tests/fixtures/0268/ast.txt
vendored
Normal 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
48
tests/fixtures/0268/tokens.txt
vendored
Normal 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,
|
||||
),
|
||||
},
|
||||
]
|
Loading…
Reference in New Issue
Block a user