File: 110-skip.t

package info (click to toggle)
raku-json-marshal 0.0.25-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 184 kB
  • sloc: makefile: 4
file content (29 lines) | stat: -rw-r--r-- 446 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env raku

use v6;

use Test;

use JSON::Marshal;
use JSON::Fast;

class WithSkip {
    has Str $.skipped is json-skip = "skipped";
    has Str $.not-skipped = "not skipped";
}


my $c = WithSkip.new;

my $json = marshal($c);

my %data = from-json($json);

ok !(%data<skipped>:exists), "the skipped attribute isn't in the JSON";
ok %data<not-skipped>:exists, "the not skipped attribute is in the JSON";


done-testing;

# vim: ft=raku