Skip to content

Commit 9d64271

Browse files
committed
more tests
1 parent a7de370 commit 9d64271

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

git-function-history-lib/src/test_functions.rs

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
use std::error::Error;
2+
13
pub fn empty_test() {
24

35
}
@@ -40,7 +42,6 @@ impl<a>Test<a> {
4042
}
4143

4244
pub fn test_in_test_in_test() {
43-
#[derive(Debug)]
4445
pub fn empty_test() {
4546

4647
}
@@ -63,8 +64,9 @@ gdg
6364
fn empty_test<T>() -> String where T: super_trait {
6465
String::from("fn empty_test() ");
6566
fn broken() {
66-
r#"#"}"#
67+
r#"#"}"#;
6768
}
69+
String::from("fn empty_test() ")
6870
}
6971

7072
}
@@ -92,11 +94,17 @@ extern "C" {
9294
fn abs(input: i32) -> i32;
9395
}
9496

95-
pub fn function_within(t: String) -> i32 {
97+
/// function why inner doc comments no worky
98+
pub fn function_within(t: String) -> Result<i32, Box<dyn Error>> {
9699
//! function within
97-
pub fn empty_test(t: String) -> i32 {
100+
pub fn empty_test(t: String) -> Result<i32, Box<dyn Error>> {
98101
println!("empty test");
99-
t.parse()
102+
match t.parse::<i32>() {
103+
Ok(i) => Ok(i),
104+
Err(e) => Err(e)?,
105+
106+
107+
}
100108
}
101109
empty_test(t)
102110
}
@@ -115,10 +123,7 @@ where T: super_trait {
115123

116124
}
117125

118-
#[derive(Debug)]
119-
extern {
120-
pub fn empty_test(t: String) -> i32 {
121-
println!("empty test");
122-
t.parse()
123-
}
126+
127+
extern "C" {
128+
pub fn empty_test(t: String);
124129
}

0 commit comments

Comments
 (0)