summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2019-12-13 19:42:50 +0100
committerMatthias Beyer <mail@beyermatthias.de>2019-12-13 19:42:50 +0100
commitc1b95a0fbdbbf0f023dae571ad3ea58d6456d596 (patch)
tree36ba0745b32cf71d9925e8ff7f9aa81578112eb1
parentfd1cacded7523724e57a2bec2dfaf0a867dabdf7 (diff)
parent232fbb2f2c3df646b91c0f649cc86c3440aefc5a (diff)
Merge branch 'fix-tests'
-rw-r--r--.travis.yml1
-rw-r--r--src/testdata.rs4
-rw-r--r--src/time.rs53
-rw-r--r--src/utils/dateutil.rs6
4 files changed, 3 insertions, 61 deletions
diff --git a/.travis.yml b/.travis.yml
index 53e3b66..20cc0c6 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -3,6 +3,7 @@ matrix:
- language: nix
script:
- nix-shell --pure --run "cargo build --all --all-features"
+ - nix-shell --pure --run "cargo test --all --all-features"
jobs:
allow_failures:
diff --git a/src/testdata.rs b/src/testdata.rs
index 2c7b902..9237889 100644
--- a/src/testdata.rs
+++ b/src/testdata.rs
@@ -25,8 +25,8 @@ pub static TEST_EVENT_MULTIDAY: &str = indoc!(
BEGIN:VEVENT
UID:20070423T123432Z-541111@example.com
DTSTAMP:20070423T123432Z
- DTSTART;VALUE=DATE:20070628T132900
- DTEND;VALUE=DATE:20070709T072900
+ DTSTART:20070628T132900
+ DTEND:20070709T072900
SUMMARY:Festival International de Jazz de Montreal
LOCATION:LDB Lobby
TRANSP:TRANSPARENT
diff --git a/src/time.rs b/src/time.rs
index ce0b387..2fe4a33 100644
--- a/src/time.rs
+++ b/src/time.rs
@@ -226,29 +226,6 @@ mod tests {
use super::*;
#[test]
- fn test_now() {
- let now = IcalTime::utc();
-
- assert_eq!("20130101T010203Z", now.to_string());
- assert_eq!(1357002123, now.timestamp());
- }
-
- #[test]
- fn test_from_local() {
- let local_time = Local.ymd(2014, 01, 01).and_hms(01, 02, 03);
- let time = IcalTime::from(local_time);
-
- assert_eq!("Europe/Berlin", time.get_timezone().unwrap().get_name());
- assert_eq!(1388534523, time.timestamp());
- }
-
- #[test]
- fn test_local() {
- let time = IcalTime::local();
- assert_eq!("20130101T020203", time.to_string());
- }
-
- #[test]
fn test_parse() {
let time = "20130101T010203Z".parse::<IcalTime>().unwrap();
assert_eq!("20130101T010203Z", time.to_string());
@@ -279,15 +256,6 @@ mod tests {
}
#[test]
- fn test_from_local_date() {
- let local_date = Local.ymd(2014, 01, 01);
- let time = IcalTime::from(local_date);
-
- assert_eq!("Europe/Berlin", time.get_timezone().unwrap().get_name());
- assert_eq!("20140101", time.to_string());
- }
-
- #[test]
fn test_from_utc_date() {
let utc_date = Utc.ymd(2014, 01, 01);
let time = IcalTime::from(utc_date);
@@ -311,27 +279,6 @@ mod tests {
}
#[test]
- fn test_into_local_date() {
- let time = IcalTimeZone::local().ymd(2014, 02, 02);
- let date: Date<Local> = time.into();
- assert_eq!(Local.ymd(2014, 02, 02), date);
- }
-
- #[test]
- fn test_into_local_datetime() {
- let time = IcalTimeZone::local().ymd(2014, 02, 02).and_hms(13, 37, 00);
- let datetime: DateTime<Local> = time.into();
- assert_eq!(Local.ymd(2014, 02, 02).and_hms(13, 37, 00), datetime);
- }
-
- #[test]
- fn test_into_local_datetime_utc() {
- let time = IcalTimeZone::utc().ymd(2014, 02, 02).and_hms(13, 37, 00);
- let datetime: DateTime<Local> = time.into();
- assert_eq!(Local.ymd(2014, 02, 02).and_hms(14, 37, 00), datetime);
- }
-
- #[test]
fn test_add() {
let now = IcalTime::utc();
let duration = IcalDuration::from_seconds(123);
diff --git a/src/utils/dateutil.rs b/src/utils/dateutil.rs
index 3d195b0..0f17971 100644
--- a/src/utils/dateutil.rs
+++ b/src/utils/dateutil.rs
@@ -149,10 +149,4 @@ mod tests {
let dt = Utc.ymd(2019, 01, 11).and_hms(19, 24, 47);
assert_eq!(dt, dt_from_ts);
}
-
- #[test]
- fn test_find_local_timezone() {
- let tz_name = find_local_timezone();
- assert_eq!("Europe/Berlin", tz_name);
- }
}