diff options
author | Dominique Dumont <dod@debian.org> | 2019-12-20 16:17:13 +0100 |
---|---|---|
committer | Dominique Dumont <dod@debian.org> | 2019-12-20 16:18:11 +0100 |
commit | 481b3df20f23d24e8021c4f100d66fe4c52fbabb (patch) | |
tree | d8d6ed9f385acc3b132f6b62225298953835309d | |
parent | 029b9ef1a6591f2ed1d90f1f74db2c074358aa39 (diff) |
Test that YAML does not load object
-rw-r--r-- | t/lib/SneakyObject.pm | 16 | ||||
-rw-r--r-- | t/model_tests.d/dpkg-examples/rakudo-star/debian/fill.copyright.blanks.yml | 3 | ||||
-rw-r--r-- | t/model_tests.t | 3 |
3 files changed, 21 insertions, 1 deletions
diff --git a/t/lib/SneakyObject.pm b/t/lib/SneakyObject.pm new file mode 100644 index 00000000..5d5ad463 --- /dev/null +++ b/t/lib/SneakyObject.pm @@ -0,0 +1,16 @@ +package SneakyObject; + +use strict; +use warnings; +use Test::More; +use 5.10.1; + +# class used with some fill.copyright.blanks.yml to check that object +# cannot be created from YAML files + +sub DESTROY { + fail "SneakyObject was loaded from YAML data\n"; +} + +1; + diff --git a/t/model_tests.d/dpkg-examples/rakudo-star/debian/fill.copyright.blanks.yml b/t/model_tests.d/dpkg-examples/rakudo-star/debian/fill.copyright.blanks.yml index f4b0a08f..c8471cc4 100644 --- a/t/model_tests.d/dpkg-examples/rakudo-star/debian/fill.copyright.blanks.yml +++ b/t/model_tests.d/dpkg-examples/rakudo-star/debian/fill.copyright.blanks.yml @@ -3,7 +3,8 @@ license: Artistic-2.0 README: license: Artistic-2.0 -debian: +# check that YAML is defanged +debian: !!perl/hash:SneakyObject license: Artistic-2.0 .*jquery.*: skip: 0 diff --git a/t/model_tests.t b/t/model_tests.t index 1a67890b..a80f2f7f 100644 --- a/t/model_tests.t +++ b/t/model_tests.t @@ -5,6 +5,9 @@ use strict; use Config::Model::Tester 4.002; +use lib 't/lib'; +use SneakyObject; + $::_use_log4perl_to_warn =1; run_tests() ; |