1
0
forked from M-Labs/nac3

nac3parser: fix broken tests

This commit is contained in:
ychenfo 2022-03-08 02:36:40 +08:00
parent f7e62ab5b7
commit d848c2284e
11 changed files with 41 additions and 93 deletions

View File

@ -1460,16 +1460,16 @@ class Foo(A, B):
tokens,
vec![
Tok::Int {
value: Some(47i64),
value: 47i128,
},
Tok::Int {
value: Some(13i64),
value: 13i128,
},
Tok::Int {
value: Some(0i64),
value: 0i128,
},
Tok::Int {
value: Some(123i64),
value: 123i128,
},
Tok::Float { value: 0.2 },
Tok::Complex {
@ -1492,7 +1492,7 @@ class Foo(A, B):
fn $name() {
let source = format!(r"99232 # {}", $eol);
let tokens = lex_source(&source);
assert_eq!(tokens, vec![Tok::Int { value: Some(99232i64) }, Tok::Newline]);
assert_eq!(tokens, vec![Tok::Int { value: 99232i128 }, Tok::Newline]);
}
)*
}
@ -1515,9 +1515,9 @@ class Foo(A, B):
assert_eq!(
tokens,
vec![
Tok::Int { value: Some(123i64) },
Tok::Int { value: 123i128 },
Tok::Newline,
Tok::Int { value: Some(456i64) },
Tok::Int { value: 456i128 },
Tok::Newline,
]
)
@ -1544,15 +1544,15 @@ class Foo(A, B):
},
Tok::Equal,
Tok::Int {
value: Some(99i64)
value: 99i128
},
Tok::Plus,
Tok::Int {
value: Some(2i64)
value: 2i128
},
Tok::Minus,
Tok::Int {
value: Some(0i64)
value: 0i128
},
Tok::Newline,
]
@ -1579,7 +1579,7 @@ class Foo(A, B):
Tok::Newline,
Tok::Indent,
Tok::Return,
Tok::Int { value: Some(99i64) },
Tok::Int { value: 99i128 },
Tok::Newline,
Tok::Dedent,
]
@ -1622,7 +1622,7 @@ class Foo(A, B):
Tok::Newline,
Tok::Indent,
Tok::Return,
Tok::Int { value: Some(99i64) },
Tok::Int { value: 99i128 },
Tok::Newline,
Tok::Dedent,
Tok::Dedent,
@ -1660,7 +1660,7 @@ class Foo(A, B):
Tok::Newline,
Tok::Indent,
Tok::Return,
Tok::Int { value: Some(99i64) },
Tok::Int { value: 99i128 },
Tok::Newline,
Tok::Dedent,
Tok::Dedent,
@ -1698,9 +1698,9 @@ class Foo(A, B):
},
Tok::Equal,
Tok::Lsqb,
Tok::Int { value: Some(1i64) },
Tok::Int { value: 1i128 },
Tok::Comma,
Tok::Int { value: Some(2i64) },
Tok::Int { value: 2i128 },
Tok::Rsqb,
Tok::Newline,
]

View File

@ -35,9 +35,7 @@ Located {
custom: (),
node: Constant {
value: Int(
Some(
42,
),
42,
),
kind: None,
},
@ -57,9 +55,7 @@ Located {
custom: (),
node: Constant {
value: Int(
Some(
42,
),
42,
),
kind: None,
},

View File

@ -35,9 +35,7 @@ Located {
custom: (),
node: Constant {
value: Int(
Some(
1,
),
1,
),
kind: None,
},
@ -57,9 +55,7 @@ Located {
custom: (),
node: Constant {
value: Int(
Some(
2,
),
2,
),
kind: None,
},

View File

@ -221,9 +221,7 @@ expression: "parse_program(&source, Default::default()).unwrap()"
custom: (),
node: Constant {
value: Int(
Some(
3,
),
3,
),
kind: None,
},
@ -279,9 +277,7 @@ expression: "parse_program(&source, Default::default()).unwrap()"
custom: (),
node: Constant {
value: Int(
Some(
3,
),
3,
),
kind: None,
},
@ -336,9 +332,7 @@ expression: "parse_program(&source, Default::default()).unwrap()"
custom: (),
node: Constant {
value: Int(
Some(
3,
),
3,
),
kind: None,
},
@ -431,9 +425,7 @@ expression: "parse_program(&source, Default::default()).unwrap()"
custom: (),
node: Constant {
value: Int(
Some(
3,
),
3,
),
kind: None,
},

View File

@ -96,9 +96,7 @@ expression: "parse_program(&source, Default::default()).unwrap()"
custom: (),
node: Constant {
value: Int(
Some(
1,
),
1,
),
kind: None,
},
@ -225,9 +223,7 @@ expression: "parse_program(&source, Default::default()).unwrap()"
custom: (),
node: Constant {
value: Int(
Some(
2,
),
2,
),
kind: None,
},
@ -282,9 +278,7 @@ expression: "parse_program(&source, Default::default()).unwrap()"
custom: (),
node: Constant {
value: Int(
Some(
1,
),
1,
),
kind: None,
},
@ -301,9 +295,7 @@ expression: "parse_program(&source, Default::default()).unwrap()"
custom: (),
node: Constant {
value: Int(
Some(
2,
),
2,
),
kind: None,
},
@ -338,9 +330,7 @@ expression: "parse_program(&source, Default::default()).unwrap()"
custom: (),
node: Constant {
value: Int(
Some(
1,
),
1,
),
kind: None,
},
@ -367,9 +357,7 @@ expression: "parse_program(&source, Default::default()).unwrap()"
custom: (),
node: Constant {
value: Int(
Some(
3,
),
3,
),
kind: None,
},

View File

@ -159,9 +159,7 @@ Located {
custom: (),
node: Constant {
value: Int(
Some(
5,
),
5,
),
kind: None,
},
@ -208,9 +206,7 @@ Located {
custom: (),
node: Constant {
value: Int(
Some(
10,
),
10,
),
kind: None,
},

View File

@ -26,9 +26,7 @@ expression: parse_ast
custom: (),
node: Constant {
value: Int(
Some(
1,
),
1,
),
kind: None,
},
@ -55,9 +53,7 @@ expression: parse_ast
custom: (),
node: Constant {
value: Int(
Some(
10,
),
10,
),
kind: None,
},
@ -88,9 +84,7 @@ expression: parse_ast
custom: (),
node: Constant {
value: Int(
Some(
2,
),
2,
),
kind: None,
},
@ -117,9 +111,7 @@ expression: parse_ast
custom: (),
node: Constant {
value: Int(
Some(
20,
),
20,
),
kind: None,
},
@ -150,9 +142,7 @@ expression: parse_ast
custom: (),
node: Constant {
value: Int(
Some(
30,
),
30,
),
kind: None,
},

View File

@ -82,9 +82,7 @@ expression: parse_ast
custom: (),
node: Constant {
value: Int(
Some(
2,
),
2,
),
kind: None,
},

View File

@ -67,9 +67,7 @@ expression: parse_ast
custom: (),
node: Constant {
value: Int(
Some(
2,
),
2,
),
kind: None,
},

View File

@ -82,9 +82,7 @@ expression: "parse_program(&source, Default::default()).unwrap()"
custom: (),
node: Constant {
value: Int(
Some(
4,
),
4,
),
kind: None,
},
@ -100,9 +98,7 @@ expression: "parse_program(&source, Default::default()).unwrap()"
custom: (),
node: Constant {
value: Int(
Some(
5,
),
5,
),
kind: None,
},

View File

@ -67,9 +67,7 @@ expression: "parse_program(&source, Default::default()).unwrap()"
custom: (),
node: Constant {
value: Int(
Some(
3,
),
3,
),
kind: None,
},