aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2024-08-22 20:28:52 -0700
committerPinapelz <yukais@pinapelz.com>2024-08-22 20:28:52 -0700
commita2972868cfc52fb0863ff49ac6d34690f7628ac9 (patch)
treeff00e486293ba5e468b9a29be81cf8d69c710cc9
parent0e69cec02fe26114bc1abf1c5470c0053d0ceaa4 (diff)
add unittest template
-rw-r--r--tests/tests.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/tests.rs b/tests/tests.rs
new file mode 100644
index 0000000..58d409e
--- /dev/null
+++ b/tests/tests.rs
@@ -0,0 +1,20 @@
+extern crate ffxiv_chronowatcher;
+
+use ffxiv_chronowatcher::eorzean_time::{convert_to_eorzean_date, EorzeanDate};
+
+mod time_tests {
+ use super::*;
+ #[test]
+ fn test_convert_to_eorzean_date() {
+ let unix_timestamp = 1661114514;
+ let eorzean_date = convert_to_eorzean_date(unix_timestamp);
+ assert_eq!(eorzean_date.years, 1);
+ assert_eq!(eorzean_date.suns, 12);
+ assert_eq!(eorzean_date.bells, 12);
+ assert_eq!(eorzean_date.minutes, 4);
+ assert_eq!(eorzean_date.guardian, "Halone");
+ assert_eq!(eorzean_date.phase, "Waxing Gibbous");
+ assert_eq!(eorzean_date.moon, "First Astral Moon");
+ }
+}
+
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage