Add functional tests for strftime with utf8 and binary strings
@@ -38,3 +38,20 @@ impl From<TimeError> for Error {
ArgumentError::from(format!("{}", error)).into()
}
}
+
+#[cfg(test)]
+mod tests {
+ use crate::test::prelude::*;
+
+ const SUBJECT: &str = "Time";
+ const FUNCTIONAL_TEST: &[u8] = include_bytes!("time_test.rb");
+
+ #[test]
+ fn functional() {
+ let mut interp = interpreter();
+ let result = interp.eval(FUNCTIONAL_TEST);
+ unwrap_or_panic_with_backtrace(&mut interp, SUBJECT, result);
+ let result = interp.eval(b"spec");
+ unwrap_or_panic_with_backtrace(&mut interp, SUBJECT, result);
+ }
+}
