mirror of
https://github.com/storytold/effectcraft.git
synced 2026-11-16 09:35:34 +00:00
test(lottie): cover archive without animation
This commit is contained in:
@@ -12,7 +12,7 @@ use effectcraft_render::render_frame;
|
||||
use effectcraft_time::{FrameRate, Tick};
|
||||
use serde_json::{Value as Json, json};
|
||||
|
||||
use crate::{ExportOptions, export_comp, import};
|
||||
use crate::{ExportOptions, LottieError, export_comp, import};
|
||||
|
||||
fn s(x: f64) -> Tick {
|
||||
Tick::from_seconds_f64(x)
|
||||
@@ -799,6 +799,14 @@ fn dotlottie_archive_roundtrip() {
|
||||
assert_eq!(q.comp(imp.comp).unwrap().layers.len(), 1);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn dotlottie_archive_without_animation_is_rejected() {
|
||||
let zip = craft_lottie::zip::try_store(&[("manifest.json".into(), b"{}".to_vec())]).unwrap();
|
||||
let mut project = Project::default();
|
||||
let err = import(&mut project, &zip, "empty archive", "", &mut |_| None).unwrap_err();
|
||||
assert!(matches!(err, LottieError::Parse(message) if message.contains("without a JSON animation")));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn deflated_dotlottie_archive_imports() {
|
||||
let (mut p, cid) = setup();
|
||||
|
||||
Reference in New Issue
Block a user