Skip to content

Commit cf66a55

Browse files
committed
Move remaining singleton ancestor test into submodule
1 parent 95959eb commit cf66a55

1 file changed

Lines changed: 30 additions & 30 deletions

File tree

rust/rubydex/src/resolution_tests.rs

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2454,6 +2454,36 @@ mod singleton_ancestors_tests {
24542454
["Foo::<Foo>", "Bar", "Module", "Object", "Kernel", "BasicObject"]
24552455
);
24562456
}
2457+
2458+
#[test]
2459+
fn singleton_class_created_in_remaining_definitions_has_linearized_ancestors() {
2460+
let mut context = GraphTest::new();
2461+
context.index_uri(
2462+
"file:///foo.rb",
2463+
r"
2464+
class Foo
2465+
@var = 1
2466+
end
2467+
",
2468+
);
2469+
context.resolve();
2470+
2471+
assert_no_diagnostics!(&context);
2472+
assert_ancestors_eq!(
2473+
context,
2474+
"Foo::<Foo>",
2475+
[
2476+
"Foo::<Foo>",
2477+
"Object::<Object>",
2478+
"BasicObject::<BasicObject>",
2479+
"Class",
2480+
"Module",
2481+
"Object",
2482+
"Kernel",
2483+
"BasicObject"
2484+
]
2485+
);
2486+
}
24572487
}
24582488

24592489
mod method_tests {
@@ -4877,36 +4907,6 @@ mod rbs_tests {
48774907
}
48784908
}
48794909

4880-
#[test]
4881-
fn singleton_class_created_in_remaining_definitions_has_linearized_ancestors() {
4882-
let mut context = GraphTest::new();
4883-
context.index_uri(
4884-
"file:///foo.rb",
4885-
r"
4886-
class Foo
4887-
@var = 1
4888-
end
4889-
",
4890-
);
4891-
context.resolve();
4892-
4893-
assert_no_diagnostics!(&context);
4894-
assert_ancestors_eq!(
4895-
context,
4896-
"Foo::<Foo>",
4897-
[
4898-
"Foo::<Foo>",
4899-
"Object::<Object>",
4900-
"BasicObject::<BasicObject>",
4901-
"Class",
4902-
"Module",
4903-
"Object",
4904-
"Kernel",
4905-
"BasicObject"
4906-
]
4907-
);
4908-
}
4909-
49104910
mod visibility_resolution_tests {
49114911
use super::*;
49124912
use crate::model::visibility::Visibility;

0 commit comments

Comments
 (0)