diff --git a/gegl/tests/bloom.rs b/gegl/tests/bloom.rs new file mode 100644 index 0000000..5d8c2d8 --- /dev/null +++ b/gegl/tests/bloom.rs @@ -0,0 +1,25 @@ +use { + gegl::{Bloom, GeglOperation}, + insta::assert_debug_snapshot, +}; + +#[test] +fn test_bloom_graph() { + let mut graphs = vec![]; + + let op = Bloom { + limit_exposure: true, + radius: 100_f64, + softness: 100_f64, + ..Default::default() + }; + + let default = Bloom::default(); + + graphs.push(("non-default: exclude defaults", op.graph(false))); + graphs.push(("non-default: include defaults", op.graph(true))); + graphs.push(("default: exclude defaults", default.graph(false))); + graphs.push(("default: include defaults", default.graph(true))); + + assert_debug_snapshot!("graphs", graphs); +} diff --git a/gegl/tests/cartoon.rs b/gegl/tests/cartoon.rs new file mode 100644 index 0000000..5fc35d6 --- /dev/null +++ b/gegl/tests/cartoon.rs @@ -0,0 +1,23 @@ +use { + gegl::{Cartoon, GeglOperation}, + insta::assert_debug_snapshot, +}; + +#[test] +fn test_cartoon_graph() { + let mut graphs = vec![]; + + let op = Cartoon { + mask_radius: 0.1, + ..Default::default() + }; + + let default = Cartoon::default(); + + graphs.push(("non-default: exclude defaults", op.graph(false))); + graphs.push(("non-default: include defaults", op.graph(true))); + graphs.push(("default: exclude defaults", default.graph(false))); + graphs.push(("default: include defaults", default.graph(true))); + + assert_debug_snapshot!("graphs", graphs); +} diff --git a/gegl/tests/snapshots/bloom__graphs.snap b/gegl/tests/snapshots/bloom__graphs.snap new file mode 100644 index 0000000..d3972cc --- /dev/null +++ b/gegl/tests/snapshots/bloom__graphs.snap @@ -0,0 +1,43 @@ +--- +source: gegl/tests/bloom.rs +expression: graphs +--- +[ + ( + "non-default: exclude defaults", + [ + "gegl:bloom", + "limit_exposure=true", + "radius=100", + "softness=100", + ], + ), + ( + "non-default: include defaults", + [ + "gegl:bloom", + "limit_exposure=true", + "radius=100", + "softness=100", + "strength=50", + "threshold=50", + ], + ), + ( + "default: exclude defaults", + [ + "gegl:bloom", + ], + ), + ( + "default: include defaults", + [ + "gegl:bloom", + "limit_exposure=false", + "radius=10", + "softness=25", + "strength=50", + "threshold=50", + ], + ), +] diff --git a/gegl/tests/snapshots/cartoon__graphs.snap b/gegl/tests/snapshots/cartoon__graphs.snap new file mode 100644 index 0000000..3040ce7 --- /dev/null +++ b/gegl/tests/snapshots/cartoon__graphs.snap @@ -0,0 +1,35 @@ +--- +source: gegl/tests/cartoon.rs +expression: graphs +--- +[ + ( + "non-default: exclude defaults", + [ + "gegl:cartoon", + "mask_radius=0.1", + ], + ), + ( + "non-default: include defaults", + [ + "gegl:cartoon", + "mask_radius=0.1", + "pct_black=0.2", + ], + ), + ( + "default: exclude defaults", + [ + "gegl:cartoon", + ], + ), + ( + "default: include defaults", + [ + "gegl:cartoon", + "mask_radius=7", + "pct_black=0.2", + ], + ), +]