From d848c2284e30d80d6749b622df6ffeea9760b0d6 Mon Sep 17 00:00:00 2001 From: ychenfo Date: Tue, 8 Mar 2022 02:36:40 +0800 Subject: [PATCH] nac3parser: fix broken tests --- nac3parser/src/lexer.rs | 30 +++++++++---------- ..._fstring__tests__parse_fstring_equals.snap | 8 ++--- ...ring__tests__parse_fstring_not_equals.snap | 8 ++--- ...ser__parser__tests__comment_ambiguity.snap | 16 +++------- ...c3parser__parser__tests__more_comment.snap | 24 ++++----------- ...ests__parse_double_list_comprehension.snap | 8 ++--- ...er__parser__tests__parse_if_elif_else.snap | 20 ++++--------- ...c3parser__parser__tests__parse_kwargs.snap | 4 +-- ...3parser__parser__tests__parse_print_2.snap | 4 +-- ...c3parser__parser__tests__parse_tuples.snap | 8 ++--- ...parser__parser__tests__sample_comment.snap | 4 +-- 11 files changed, 41 insertions(+), 93 deletions(-) diff --git a/nac3parser/src/lexer.rs b/nac3parser/src/lexer.rs index 36c593732..6804df05b 100644 --- a/nac3parser/src/lexer.rs +++ b/nac3parser/src/lexer.rs @@ -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, ] diff --git a/nac3parser/src/snapshots/nac3parser__fstring__tests__parse_fstring_equals.snap b/nac3parser/src/snapshots/nac3parser__fstring__tests__parse_fstring_equals.snap index 62b4c68b0..09e9cd248 100644 --- a/nac3parser/src/snapshots/nac3parser__fstring__tests__parse_fstring_equals.snap +++ b/nac3parser/src/snapshots/nac3parser__fstring__tests__parse_fstring_equals.snap @@ -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, }, diff --git a/nac3parser/src/snapshots/nac3parser__fstring__tests__parse_fstring_not_equals.snap b/nac3parser/src/snapshots/nac3parser__fstring__tests__parse_fstring_not_equals.snap index b29d04e58..5bb48377e 100644 --- a/nac3parser/src/snapshots/nac3parser__fstring__tests__parse_fstring_not_equals.snap +++ b/nac3parser/src/snapshots/nac3parser__fstring__tests__parse_fstring_not_equals.snap @@ -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, }, diff --git a/nac3parser/src/snapshots/nac3parser__parser__tests__comment_ambiguity.snap b/nac3parser/src/snapshots/nac3parser__parser__tests__comment_ambiguity.snap index 421e3f260..da164509e 100644 --- a/nac3parser/src/snapshots/nac3parser__parser__tests__comment_ambiguity.snap +++ b/nac3parser/src/snapshots/nac3parser__parser__tests__comment_ambiguity.snap @@ -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, }, diff --git a/nac3parser/src/snapshots/nac3parser__parser__tests__more_comment.snap b/nac3parser/src/snapshots/nac3parser__parser__tests__more_comment.snap index 15d27b423..4b93ccd66 100644 --- a/nac3parser/src/snapshots/nac3parser__parser__tests__more_comment.snap +++ b/nac3parser/src/snapshots/nac3parser__parser__tests__more_comment.snap @@ -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, }, diff --git a/nac3parser/src/snapshots/nac3parser__parser__tests__parse_double_list_comprehension.snap b/nac3parser/src/snapshots/nac3parser__parser__tests__parse_double_list_comprehension.snap index 87b7eb535..ab163694c 100644 --- a/nac3parser/src/snapshots/nac3parser__parser__tests__parse_double_list_comprehension.snap +++ b/nac3parser/src/snapshots/nac3parser__parser__tests__parse_double_list_comprehension.snap @@ -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, }, diff --git a/nac3parser/src/snapshots/nac3parser__parser__tests__parse_if_elif_else.snap b/nac3parser/src/snapshots/nac3parser__parser__tests__parse_if_elif_else.snap index b4f6c17be..5d019f46a 100644 --- a/nac3parser/src/snapshots/nac3parser__parser__tests__parse_if_elif_else.snap +++ b/nac3parser/src/snapshots/nac3parser__parser__tests__parse_if_elif_else.snap @@ -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, }, diff --git a/nac3parser/src/snapshots/nac3parser__parser__tests__parse_kwargs.snap b/nac3parser/src/snapshots/nac3parser__parser__tests__parse_kwargs.snap index b95efef1a..9bfdff799 100644 --- a/nac3parser/src/snapshots/nac3parser__parser__tests__parse_kwargs.snap +++ b/nac3parser/src/snapshots/nac3parser__parser__tests__parse_kwargs.snap @@ -82,9 +82,7 @@ expression: parse_ast custom: (), node: Constant { value: Int( - Some( - 2, - ), + 2, ), kind: None, }, diff --git a/nac3parser/src/snapshots/nac3parser__parser__tests__parse_print_2.snap b/nac3parser/src/snapshots/nac3parser__parser__tests__parse_print_2.snap index 7248ea0a9..07336aa9f 100644 --- a/nac3parser/src/snapshots/nac3parser__parser__tests__parse_print_2.snap +++ b/nac3parser/src/snapshots/nac3parser__parser__tests__parse_print_2.snap @@ -67,9 +67,7 @@ expression: parse_ast custom: (), node: Constant { value: Int( - Some( - 2, - ), + 2, ), kind: None, }, diff --git a/nac3parser/src/snapshots/nac3parser__parser__tests__parse_tuples.snap b/nac3parser/src/snapshots/nac3parser__parser__tests__parse_tuples.snap index 76e004915..09d602ab1 100644 --- a/nac3parser/src/snapshots/nac3parser__parser__tests__parse_tuples.snap +++ b/nac3parser/src/snapshots/nac3parser__parser__tests__parse_tuples.snap @@ -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, }, diff --git a/nac3parser/src/snapshots/nac3parser__parser__tests__sample_comment.snap b/nac3parser/src/snapshots/nac3parser__parser__tests__sample_comment.snap index d1ae6a41a..b5689c5ac 100644 --- a/nac3parser/src/snapshots/nac3parser__parser__tests__sample_comment.snap +++ b/nac3parser/src/snapshots/nac3parser__parser__tests__sample_comment.snap @@ -67,9 +67,7 @@ expression: "parse_program(&source, Default::default()).unwrap()" custom: (), node: Constant { value: Int( - Some( - 3, - ), + 3, ), kind: None, },