Create a quick calculation and test to make sure it works.

This commit is contained in:
Dorian 2019-02-04 09:05:11 -05:00
parent de0f7b897e
commit de201f3cfa
3 changed files with 12 additions and 4 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
/target
**/*.rs.bk
Cargo.lock
.idea

View File

@ -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"

View File

@ -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);
}
}
}