Create a quick calculation and test to make sure it works.
This commit is contained in:
parent
de0f7b897e
commit
de201f3cfa
|
@ -1,3 +1,4 @@
|
|||
/target
|
||||
**/*.rs.bk
|
||||
Cargo.lock
|
||||
.idea
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[package]
|
||||
name = "embedded-uptime"
|
||||
name = "embedded-unit-converter"
|
||||
version = "0.1.0"
|
||||
authors = ["Dorian Pula <dorian.pula@points.com>"]
|
||||
edition = "2018"
|
||||
|
|
13
src/lib.rs
13
src/lib.rs
|
@ -1,7 +1,14 @@
|
|||
fn convert_celsius_to_fahrenheit(celsius: f32) -> f32 {
|
||||
celsius * 1.8 + 32.0
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
|
||||
use super::convert_celsius_to_fahrenheit;
|
||||
|
||||
#[test]
|
||||
fn it_works() {
|
||||
assert_eq!(2 + 2, 4);
|
||||
fn conversion_celsius_to_fahrenheit() {
|
||||
assert_eq!(convert_celsius_to_fahrenheit(25.0), 77.0);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue