test(parser): update class def

This commit is contained in:
GreasySlug 2023-02-14 21:44:59 +09:00
parent e50d208474
commit 855be06c26
3 changed files with 8 additions and 4 deletions

View file

@ -5,6 +5,11 @@ indent = "indent is needed"
Pub.
{a: 1} # invalid attribute
Pub.
a = 1
{x = 1; y = 2}
b = 2
Pri = Class()
Priv.
indent = "indent is needed"

View file

@ -74,7 +74,7 @@ fn expect_failure_collections_err() -> Result<(), ()> {
#[test]
fn expect_failure_class_def_err() -> Result<(), ()> {
expect_failure("tests/invalid_class_definition.er", 4)
expect_failure("tests/invalid_class_definition.er", 6)
}
fn _parse_test_from_code(file_path: &'static str) -> Result<(), ParserRunnerErrors> {

View file

@ -110,7 +110,7 @@ fn exec_repl_class_def_with_deco() -> Result<(), ()> {
#[test]
#[ignore]
fn exec_invalid_class_inheritable() -> Result<(), ()> {
expect_repl_failure(
expect_repl_success(
"repl_auto_indent_dedent",
[
"@Inheritable",
@ -136,7 +136,6 @@ fn exec_invalid_class_inheritable() -> Result<(), ()> {
.into_iter()
.map(|line| line.to_string())
.collect(),
2,
)
}
@ -188,7 +187,7 @@ fn exec_repl_invalid_indent() -> Result<(), ()> {
fn exec_repl_invalid_def_after_the_at_sign() -> Result<(), ()> {
expect_repl_failure(
"repl_invalid_indent",
["@decorator", "a = 1", "exit()"]
["@decorator", "a = 1", "", "exit()"]
.into_iter()
.map(|x| x.to_string())
.collect(),