Skip to content

Commit 62239a6

Browse files
author
build
committed
feat:exercises
1 parent 6db16c8 commit 62239a6

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

exercises/tests/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

exercises/tests/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
2-
name = "tests7"
2+
name = "tests8"
33
version = "0.0.1"
44
edition = "2021"
55
[[bin]]
6-
name = "tests7"
7-
path = "tests7.rs"
6+
name = "tests8"
7+
path = "tests8.rs"

exercises/tests/tests9.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,15 @@
3030
// I AM NOT DONE
3131

3232
extern "Rust" {
33+
#[link_name = "Foo:my_demo_function"]
3334
fn my_demo_function(a: u32) -> u32;
35+
#[link_name = "Foo:my_demo_function"]
3436
fn my_demo_function_alias(a: u32) -> u32;
3537
}
3638

3739
mod Foo {
3840
// No `extern` equals `extern "Rust"`.
41+
#[no_mangle]
3942
fn my_demo_function(a: u32) -> u32 {
4043
a
4144
}
@@ -54,8 +57,8 @@ mod tests {
5457
// SAFETY: We know those functions are aliases of a safe
5558
// Rust function.
5659
unsafe {
57-
my_demo_function(123);
58-
my_demo_function_alias(456);
60+
assert_eq!(my_demo_function(123), 123);
61+
assert_eq!(my_demo_function_alias(456), 456);
5962
}
6063
}
6164
}

0 commit comments

Comments
 (0)