Add initial canary-textwrap crate
This commit is contained in:
parent
d62f8f746a
commit
feec4de657
|
@ -4,6 +4,7 @@ members = [
|
||||||
"apps/music-player",
|
"apps/music-player",
|
||||||
"apps/sandbox",
|
"apps/sandbox",
|
||||||
"crates/script",
|
"crates/script",
|
||||||
|
"crates/textwrap",
|
||||||
"scripts/music-player",
|
"scripts/music-player",
|
||||||
"scripts/sao-ui",
|
"scripts/sao-ui",
|
||||||
]
|
]
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
[package]
|
||||||
|
name = "canary-textwrap"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2021"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
canary-script = { path = "../script" }
|
||||||
|
textwrap = "0.16"
|
|
@ -0,0 +1,14 @@
|
||||||
|
pub fn add(left: usize, right: usize) -> usize {
|
||||||
|
left + right
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests {
|
||||||
|
use super::*;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn it_works() {
|
||||||
|
let result = add(2, 2);
|
||||||
|
assert_eq!(result, 4);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue