use stern4rust::finding::model::qualified_call::QualifiedCall;
#[test]
fn call_of_a_three_segment_path_keeps_the_module_qualifier() {
let call = QualifiedCall::new("std::env::args", 1).call();
assert_eq!(call, "env::args");
}
#[test]
fn call_of_a_two_segment_path_is_the_function_alone() {
let call = QualifiedCall::new("syn::parse_file", 1).call();
assert_eq!(call, "parse_file");
}
#[test]
fn import_of_a_three_segment_path_stops_before_the_function() {
let import = QualifiedCall::new("std::env::args", 1).import();
assert_eq!(import, "std::env");
}
#[test]
fn import_of_a_two_segment_path_is_the_whole_path() {
let import = QualifiedCall::new("syn::parse_file", 1).import();
assert_eq!(import, "syn::parse_file");
}
#[test]
fn new_keeps_every_field_it_was_given() {
let call = QualifiedCall::new("std::env::args", 42);
assert_eq!(call.path, "std::env::args");
assert_eq!(call.line, 42);
}