File: 070-parameterised.rakutest

package info (click to toggle)
raku-json-unmarshal 0.15-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 160 kB
  • sloc: makefile: 4
file content (22 lines) | stat: -rw-r--r-- 383 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!raku

use Test;
use JSON::Unmarshal;

plan 2;

class C {
	has Str %.bla{subset :: of Str where any("ble", "blob")}
}; 

my $res;

lives-ok { 
    $res = unmarshal( 「{"bla": {"ble": "bli"}}」, C);
}, "unmarshal class with hash with subset constrained values";

is $res.bla<ble> , 'bli', "and the result is what is expected";

done-testing;

# vim: expandtab shiftwidth=4 ft=raku