mirror of
https://github.com/erg-lang/erg.git
synced 2025-12-23 05:36:48 +00:00
test(parser): update class def
This commit is contained in:
parent
e50d208474
commit
855be06c26
3 changed files with 8 additions and 4 deletions
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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> {
|
||||
|
|
|
|||
|
|
@ -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(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue