summaryrefslogtreecommitdiff
path: root/examples/09-imports
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2026-07-14 19:01:50 +0100
committerMichael Williamson <mike@zwobble.org>2026-07-14 19:01:50 +0100
commit92bbc3595c39e964160660a2de9aa76b72ce727f (patch)
tree00979e144541fd594145e52fc92874b244cd2352 /examples/09-imports
parent6194d284f5559acc5f23a402f577bac655878f92 (diff)
Convert Rust examples to use cargo test
Diffstat (limited to 'examples/09-imports')
-rw-r--r--examples/09-imports/output/rust/src/main.rs16
1 files changed, 10 insertions, 6 deletions
diff --git a/examples/09-imports/output/rust/src/main.rs b/examples/09-imports/output/rust/src/main.rs
index ee3d685..ffbcbf4 100644
--- a/examples/09-imports/output/rust/src/main.rs
+++ b/examples/09-imports/output/rust/src/main.rs
@@ -1,11 +1,15 @@
mod line;
mod point;
-use line::Line;
-use point::Point;
+#[cfg(test)]
+mod test {
+ use super::line::Line;
+ use super::point::Point;
-fn main() {
- let start = Point { x: 10, y: 25 };
- let end = Point { x: 10, y: 25 };
- let line = Line { start, end };
+ #[test]
+ fn can_construct_line() {
+ let start = Point { x: 10, y: 25 };
+ let end = Point { x: 10, y: 25 };
+ let line = Line { start, end };
+ }
}