File: validate-id.t

package info (click to toggle)
libjson-validator-perl 3.06%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 616 kB
  • sloc: perl: 1,308; makefile: 6
file content (14 lines) | stat: -rw-r--r-- 345 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
  use lib '.';
  use t::Helper;

  validate_ok {id => 1}, {type => 'object'};

  validate_ok {id => 1, message => 'cannot exclude "id" #111'},
    {
    type                 => 'object',
    additionalProperties => 0,
    properties           => {message => {type => "string"}}
    },
    E('/', 'Properties not allowed: id.');

  done_testing;