forked from M-Labs/nac3
1
0
Fork 0

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,10 +35,8 @@ Located {
custom: (),
node: Constant {
value: Int(
Some(
42,
),
),
kind: None,
},
},
@ -57,10 +55,8 @@ Located {
custom: (),
node: Constant {
value: Int(
Some(
42,
),
),
kind: None,
},
},

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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