1#[must_use]
7pub fn is_overload_stub(lines: &[&str]) -> bool {
8 !lines.iter().any(|l| l.contains('{'))
9}
10
11#[cfg(test)]
12mod tests {
13 use super::*;
14
15 #[test]
16 fn stub_has_no_brace() {
17 assert!(is_overload_stub(&["function foo(x: number): string;"]));
18 }
19
20 #[test]
21 fn implementation_has_brace() {
22 assert!(!is_overload_stub(&[
23 "function foo(x: number): string {",
24 " return x.toString();",
25 "}"
26 ]));
27 }
28
29 #[test]
30 fn empty_is_stub() {
31 assert!(is_overload_stub(&[]));
32 }
33}