Giter Club home page Giter Club logo

json-marshal's Introduction

JSON::Marshal

Make JSON from an Object (the opposite of JSON::Unmarshal)

Build Status

Synopsis

   use JSON::Marshal;

    class SomeClass {
      has Str $.string;
      has Int $.int;
      has Version $.version is marshalled-by('Str');
    }

    my $object = SomeClass.new(string => "string", int => 42, version => Version.new("0.0.1"));


    my Str $json = marshal($object); # -> "{ "string" : "string", "int" : 42, "version" : "0.0.1" }'

Or with opt-in marshalling:

    use JSON::Marshal;
    use JSON::OptIn;

    class SomeClass {
      has Str $.string is json;
      has Int $.int    is json;
      has Str $.secret;
      has Version $.version is marshalled-by('Str');
    }

    my $object = SomeClass.new(secret => "secret", string => "string", int => 42, version => Version.new("0.0.1"));


    my Str $json = marshal($object, :opt-in); # -> "{ "string" : "string", "int" : 42, "version" : "0.0.1" }'

Description

This provides a single exported subroutine to create a JSON representation of an object. It should round trip back into an object of the same class using JSON::Unmarshal.

It only outputs the "public" attributes (that is those with accessors created by declaring them with the '.' twigil. Attributes without acccessors are ignored.

If you want to ignore any attributes without a value you can use the :skip-null adverb to marshal, which will supress the marshalling of any undefined attributes. Additionally if you want a finer-grained control over this behaviour there is a 'json-skip-null' attribute trait which will cause the specific attribute to be skipped if it isn't defined irrespective of the skip-null. If you want to always explicitly suppress the marshalling of an attribute then the the trait json-skip on an attribute will prevent it being output in the JSON.

By default all public attributes will be candidates to be marshalled to JSON, which may not be convenient for all applications (for example only a small number of attributes should be marshalled in a large class,) so the marshal provides an :opt-in adverb that inverts the behaviour so that only those attributes which have one of the traits that control marshalling (with the exception of json-skip,) will be candidates. The is json trait from JSON::OptIn can be supplied to an attribute to mark it for marshalling explicitly, (it is implicit in all the other traits bar json-skip.)

To allow a finer degree of control of how an attribute is marshalled an attribute trait is marshalled-by is provided, this can take either a Code object (an anonymous subroutine,) which should take as an argument the value to be marshalled and should return a value that can be completely represented as JSON, that is to say a string, number or boolean or a Hash or Array who's values are those things. Alternatively the name of a method that will be called on the value, the return value being constrained as above.

By default the JSON produced is pretty (that is newlines and indentation,) which is nice for humans to read but has a lot of superfluous characters in it, this can be controlled by passing :!pretty to marshal.

Installation

Assuming you have a working Rakudo installation, you can install this with zef :

# From the source directory

zef install .

# Remote installation

zef install JSON::Marshal

Support

Suggestions/patches are welcomed via github at

https://github.com/jonathanstowe/JSON-Marshal/issues

Licence

Please see the LICENCE file in the distribution

© Jonathan Stowe 2015, 2016, 2017, 2018, 2019, 2020, 2021

json-marshal's People

Contributors

jonathanstowe avatar skarsnik avatar ugexe avatar vrurg avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

json-marshal's Issues

Could not find JSON::Fast:ver<0.4..*>

Hello. I am not really sure if it is a JSON::Marshal problem, because lately there were some commits related to it to zef(notably ugexe/zef@bf75d24 and ugexe/zef@0ed9aab), so I am ready to re-post this issue to zef repository, just don't sure what the correct behavior must be.

On fresh rakudo and newly-built zef after installing of JSON::Marshal:

➜  1 git:(master) zef --installed list
===> Found via /home/sena/.rakudobrew/moar-nom/install/share/perl6
CORE:ver('6.c'):auth('perl')
===> Found via /home/sena/.rakudobrew/moar-nom/install/share/perl6/site
JSON::Fast:ver('0.9.1')             # === Here it is, nice and clear;
JSON::Marshal:ver('0.0.11'):auth('github:jonathanstowe')  # === And the last version is here too.
OpenSSL:ver('0.1.11'):auth('github:sergot')
zef:ver('0.1.25'):auth('github:ugexe')
JSON::Name:ver('0.0.2'):auth('github:jonathanstowe')
➜  1 git:(master) perl6
To exit type 'exit' or '^D'
> use JSON::Marshal;
===SORRY!===
Could not find JSON::Fast:ver<0.4..*> at line 60 in:  # === Bang!
    /home/sena/.perl6
    /home/sena/.rakudobrew/moar-nom/install/share/perl6/site
    /home/sena/.rakudobrew/moar-nom/install/share/perl6/vendor
    /home/sena/.rakudobrew/moar-nom/install/share/perl6
    CompUnit::Repository::AbsolutePath<65633296>
    CompUnit::Repository::NQP<52007704>
    CompUnit::Repository::Perl5<52007744>

  in any statement_control at /home/sena/.rakudobrew/moar-nom/install/share/nqp/lib/Perl6/Grammar.moarvm line 1

> 

Custom type objects aren't marshalled consistently with builtin type objects.

Builtin (undefined) types are serialized as null. This works well, and allows round-trip conversion with JSON::Class:

> marshal(Int);
null
> marshal(Str);
null

Custom classes should be serialized the same way. Instead, they're serialized the same way as a defined class, and this either causes round-trip conversion failure, or an exception, depending on whether the class has members:

> class C { }
> marshal(C);
{
}
> class D { has $.i; }
> marshal(D)
Cannot look up attributes in a D type object
  in block  at D:\rakudo-2017.12\share\perl6\site\sources\0D5D5ABC9DC9B8DB1F75571789AD2F8F5FD3487A (JSON::Marshal) line 143
  in sub _marshal at D:\rakudo-2017.12\share\perl6\site\sources\0D5D5ABC9DC9B8DB1F75571789AD2F8F5FD3487A (JSON::Marshal) line 132
  in sub marshal at D:\rakudo-2017.12\share\perl6\site\sources\0D5D5ABC9DC9B8DB1F75571789AD2F8F5FD3487A (JSON::Marshal) line 172
  in block <unit> at <unknown file> line 1

How about just a json-skip to skip attributes we do not want included...

I have been driving myself crazy trying to find a module that I can use with nested objects specifically classes. Your module is pretty close however I do not want to set the properties to null to skip the values I do not want.

It would be great if I could write a TO_JSON method or so to that returns a structure that will be marshaled by your module. Or, just use "json-skip" on attributes we don't want included in the final JSON document.

Something like:

class Something {
   has Str $.foo;
   has Str $.bar is json-skip;

}

or

class Something{ 
   has Str $.foo;
   has Str $.bar;
     
   method TO_JSON {
      return {
          foo => $.foo
      }
   }
}

Auto kebab case to _ case

It could be interesting to have something to tell marshal/unmarshal to automaticly convert kebab case to undercase (or even for CamelCase too maybe?)

P6M Merging GLOBAL symbols failed: duplicate definition of symbol Name

Trying to zef install Math::Matrix pulls in JSON::Marshal:ver<0.0.23+> as a dependency.

This fails tests JSON-Marshal-0.0.23/t/040-json-name.t:7 and JSON-Marshal-0.0.23/t/140-opt-in.t:7 with P6M Merging GLOBAL symbols failed: duplicate definition of symbol Name.

Any help much appreciated!
:)

===> Testing: JSON::Marshal:ver<0.0.23>:auth<github:jonathanstowe>:api<1.0>
[JSON::Marshal] ===SORRY!=== Error while compiling ~/.zef/tmp/JSON-Marshal-0.0.23.tar.gz/JSON-Marshal-0.0.23/t/040-json-name.t
[JSON::Marshal] P6M Merging GLOBAL symbols failed: duplicate definition of symbol Name
[JSON::Marshal] at ~/.zef/tmp/JSON-Marshal-0.0.23.tar.gz/JSON-Marshal-0.0.23/t/040-json-name.t:7
[JSON::Marshal] ===SORRY!=== Error while compiling ~/.zef/tmp/JSON-Marshal-0.0.23.tar.gz/JSON-Marshal-0.0.23/t/140-opt-in.t
[JSON::Marshal] P6M Merging GLOBAL symbols failed: duplicate definition of symbol Name
[JSON::Marshal] at ~/.zef/tmp/JSON-Marshal-0.0.23.tar.gz/JSON-Marshal-0.0.23/t/140-opt-in.t:7
===> Testing [FAIL]: JSON::Marshal:ver<0.0.23>:auth<github:jonathanstowe>:api<1.0>
Aborting due to test failure: JSON::Marshal:ver<0.0.23>:auth<github:jonathanstowe>:api<1.0> (use --force-test to override)

hi, trying to use it I got this

ubuntu@ip-172-31-47-63:~/dev/futs/scripts$ panda install JSON::Marshal
==> Fetching JSON::Marshal
==> Building JSON::Marshal
==> Testing JSON::Marshal
t/010-use.t ........ ok
t/020-marshal.t .... ok
t/030-trait.t ...... ok
t/040-json-name.t .. ok
t/050-skip-null.t .. ok
t/060-array.t ...... ok
All tests successful.
Files=6, Tests=28, 4 wallclock secs ( 0.02 usr 0.01 sys + 3.75 cusr 0.26 csys = 4.04 CPU)
Result: PASS
==> Installing JSON::Marshal
JSON::Marshal:ver<0.0.10>:authgithub:jonathanstowe:api<> already installed
in block at /home/ubuntu/rakudo/rakudo-star-2016.07/install/share/perl6/site/sources/85367160D11E565B2D089507C79BC309215430D6 (Panda::Installer) line 61
in sub indir at /home/ubuntu/rakudo/rakudo-star-2016.07/install/share/perl6/site/sources/24811C576EF8F85E7672B26955C802BB2FC94675 (Panda::Common) line 20
in method install at /home/ubuntu/rakudo/rakudo-star-2016.07/install/share/perl6/site/sources/85367160D11E565B2D089507C79BC309215430D6 (Panda::Installer) line 42
in method install at /home/ubuntu/rakudo/rakudo-star-2016.07/install/share/perl6/site/sources/582CB7486602954A4601BDCE5A0EAC54B05DA58A (Panda) line 161
in method resolve at /home/ubuntu/rakudo/rakudo-star-2016.07/install/share/perl6/site/sources/582CB7486602954A4601BDCE5A0EAC54B05DA58A (Panda) line 234
in sub MAIN at /home/ubuntu/rakudo/rakudo-star-2016.07/install/share/perl6/site/resources/E0D978079BB5081DE986D058BB8AB08252F05CC8 line 18
in block at /home/ubuntu/rakudo/rakudo-star-2016.07/install/share/perl6/site/resources/E0D978079BB5081DE986D058BB8AB08252F05CC8 line 151

Actually thrown at:
in method install at /home/ubuntu/rakudo/rakudo-star-2016.07/install/share/perl6/site/sources/85367160D11E565B2D089507C79BC309215430D6 (Panda::Installer) line 44
in method install at /home/ubuntu/rakudo/rakudo-star-2016.07/install/share/perl6/site/sources/582CB7486602954A4601BDCE5A0EAC54B05DA58A (Panda) line 161
in method resolve at /home/ubuntu/rakudo/rakudo-star-2016.07/install/share/perl6/site/sources/582CB7486602954A4601BDCE5A0EAC54B05DA58A (Panda) line 234
in sub MAIN at /home/ubuntu/rakudo/rakudo-star-2016.07/install/share/perl6/site/resources/E0D978079BB5081DE986D058BB8AB08252F05CC8 line 18
in block at /home/ubuntu/rakudo/rakudo-star-2016.07/install/share/perl6/site/resources/E0D978079BB5081DE986D058BB8AB08252F05CC8 line 151

ubuntu@ip-172-31-47-63:/dev/futs/scripts$ perl6 get_data.pl
Segmentation fault (core dumped)
ubuntu@ip-172-31-47-63:
/dev/futs/scripts$ perl6 get_data.pl
Segmentation fault (core dumped)
ubuntu@ip-172-31-47-63:~/dev/futs/scripts$ perl6 get_data.pl
Segmentation fault (core dumped)

THE CODE IS:

!/usr/bin/env perl6

use v6;
use JSON::Marshal;

my &infix:<++> = &infix:<~>;
subset IdentStr of Str where /^<.ident>$/;
subset Gênero of Str where * eq "Homem"|"Mulher";

class Técnico does JSON::Class {
my $.identidade = "Técnico";
has $.nome;
has Gênero $.gênero;
has Int $.idade;
has Rat $.rate;
}

my Str @técnicos = marshal( Técnico.new( nome => "Marcelo Oliveira", gênero => "Homem", idade => 54, rate => 3.88 ) ),
marshal( Técnico.new( nome => "Levir Culpi", gênero => "Homem", idade => 52, rate => 4.12 ) );

sub ef8a4da32a-get-json {
say @técnicos;
}

ef8a4da32a-get-json;

Could not find JSON::Fast:ver<0.16+>

Hi! Seems JSON-Marshal installation does not load JSON::Fast:

[task run: task.bash - tasks/multi-versions]
[dump code: task.bash]
[1] set -e
[2] 
[3] eval "$(~/.rakubrew/bin/rakubrew init Bash)"
[4] rakubrew download moar-$version
[5] rakubrew switch moar-$version
[6] 
[7] which raku
[8] raku --version
[9] 
[10] cd source/
[11] 
[12] zef install . --deps-only --test-depends --/test
[13] 
[14] /usr/bin/time -o "${cache_root_dir}/${version}_time" \
[15] zef test . && touch "${cache_root_dir}/${version}_ok"
[16] 
[task stdout]
21:36:11 :: Downloading https://rakudo.org/dl/rakudo/rakudo-moar-2022.07-01-linux-x86_64-gcc.tar.gz
21:36:11 :: Extracting
21:36:12 :: Done, moar-2022.07 installed
21:36:13 :: Switching to moar-2022.07
21:36:13 :: /home/worker/.rakubrew/versions/moar-2022.07/bin/raku
21:36:13 :: Welcome to Rakudo™ v2022.07.
21:36:13 :: Implementing the Raku® Programming Language v6.d.
21:36:13 :: Built on MoarVM version 2022.07.
21:36:47 :: ===> Searching for missing dependencies: AttrX::Mooish, Test::Async, Test::META, Test::When
21:37:07 :: ===> Searching for missing dependencies: META6:ver<0.0.24+>, URI, License::SPDX
21:37:07 :: ===> Searching for missing dependencies: JSON::Class:ver<0.0.15+>, JSON::Name, JSON::Class:ver<0.0.14+>
21:37:07 :: ===> Searching for missing dependencies: JSON::Marshal:ver<0.0.23+>, JSON::Unmarshal:ver<0.08+>, JSON::OptIn
21:37:07 :: ===> Installing: JSON::OptIn:ver<0.0.2>:auth<zef:jonathanstowe>
21:37:07 :: ===> Installing: JSON::Name:ver<0.0.7>:auth<zef:jonathanstowe>:api<1.0>
21:37:07 :: ===> Installing: JSON::Marshal:ver<0.0.24>:auth<zef:jonathanstowe>:api<1.0>
21:37:07 :: ===> Install [FAIL] for JSON::Marshal:ver<0.0.24>:auth<zef:jonathanstowe>:api<1.0>: ===SORRY!=== Error while compiling /var/.sparrowdo/env/main/.sparrowdo/source/site#sources/DADA798BF2352A7EF1A131ACE8CB36C2AE6BF63B (JSON::Marshal)
21:37:07 :: Could not find JSON::Fast:ver<0.16+> in:
21:37:07 ::     /home/worker/.rakubrew/versions/moar-2022.07/share/perl6/site
21:37:07 ::     /home/worker/.rakubrew/versions/moar-2022.07/share/perl6/vendor
21:37:07 ::     /home/worker/.rakubrew/versions/moar-2022.07/share/perl6/core
21:37:07 ::     CompUnit::Repository::AbsolutePath<92469008>
21:37:07 ::     CompUnit::Repository::NQP<80995336>
21:37:07 ::     CompUnit::Repository::Perl5<80995376>
21:37:07 :: at /var/.sparrowdo/env/main/.sparrowdo/source/site#sources/DADA798BF2352A7EF1A131ACE8CB36C2AE6BF63B (JSON::Marshal):108

Full log - https://ci.sparrowhub.io/report/1651

Still not sure, b/c this dependency is declared in META6.json

Possible Name conflict

I'm trying to install a package that depends on JSON-Marshal, but I'm having an error:

 ❯ zef install JSON::Marshal
===> Searching for: JSON::Marshal
===> Searching for missing dependencies: JSON::Name:ver<0.0.6+>, JSON::OptIn
===> Testing: JSON::OptIn:ver<0.0.2>:auth<zef:jonathanstowe>
===> Testing [OK] for JSON::OptIn:ver<0.0.2>:auth<zef:jonathanstowe>
===> Testing: JSON::Name:ver<0.0.7>:auth<zef:jonathanstowe>:api<1.0>
===> Testing [OK] for JSON::Name:ver<0.0.7>:auth<zef:jonathanstowe>:api<1.0>
===> Testing: JSON::Marshal:ver<0.0.24>:auth<zef:jonathanstowe>:api<1.0>
[JSON::OptIn] ===SORRY!=== Error while compiling /tmp/nix-shell.dBDVwc/.zef/bd503b57c9cff4706f3a3e18390157a2a353536e.tar.gz/JSON-Marshal-0.0.24/t/040-json-name.t
[JSON::Name] ===SORRY!=== Error while compiling /tmp/nix-shell.dBDVwc/.zef/bd503b57c9cff4706f3a3e18390157a2a353536e.tar.gz/JSON-Marshal-0.0.24/t/040-json-name.t
[JSON::Marshal] ===SORRY!=== Error while compiling /tmp/nix-shell.dBDVwc/.zef/bd503b57c9cff4706f3a3e18390157a2a353536e.tar.gz/JSON-Marshal-0.0.24/t/040-json-name.t
[JSON::OptIn] Merging GLOBAL symbols failed: duplicate definition of symbol Name
[JSON::Name] Merging GLOBAL symbols failed: duplicate definition of symbol Name
[JSON::Marshal] Merging GLOBAL symbols failed: duplicate definition of symbol Name
[JSON::OptIn] at /tmp/nix-shell.dBDVwc/.zef/bd503b57c9cff4706f3a3e18390157a2a353536e.tar.gz/JSON-Marshal-0.0.24/t/040-json-name.t:7
[JSON::Name] at /tmp/nix-shell.dBDVwc/.zef/bd503b57c9cff4706f3a3e18390157a2a353536e.tar.gz/JSON-Marshal-0.0.24/t/040-json-name.t:7
[JSON::Marshal] at /tmp/nix-shell.dBDVwc/.zef/bd503b57c9cff4706f3a3e18390157a2a353536e.tar.gz/JSON-Marshal-0.0.24/t/040-json-name.t:7
[JSON::OptIn] ===SORRY!=== Error while compiling /tmp/nix-shell.dBDVwc/.zef/bd503b57c9cff4706f3a3e18390157a2a353536e.tar.gz/JSON-Marshal-0.0.24/t/140-opt-in.t
[JSON::Name] ===SORRY!=== Error while compiling /tmp/nix-shell.dBDVwc/.zef/bd503b57c9cff4706f3a3e18390157a2a353536e.tar.gz/JSON-Marshal-0.0.24/t/140-opt-in.t
[JSON::Marshal] ===SORRY!=== Error while compiling /tmp/nix-shell.dBDVwc/.zef/bd503b57c9cff4706f3a3e18390157a2a353536e.tar.gz/JSON-Marshal-0.0.24/t/140-opt-in.t
[JSON::OptIn] Merging GLOBAL symbols failed: duplicate definition of symbol Name
[JSON::Name] Merging GLOBAL symbols failed: duplicate definition of symbol Name
[JSON::Marshal] Merging GLOBAL symbols failed: duplicate definition of symbol Name
[JSON::OptIn] at /tmp/nix-shell.dBDVwc/.zef/bd503b57c9cff4706f3a3e18390157a2a353536e.tar.gz/JSON-Marshal-0.0.24/t/140-opt-in.t:7
[JSON::Name] at /tmp/nix-shell.dBDVwc/.zef/bd503b57c9cff4706f3a3e18390157a2a353536e.tar.gz/JSON-Marshal-0.0.24/t/140-opt-in.t:7
[JSON::Marshal] at /tmp/nix-shell.dBDVwc/.zef/bd503b57c9cff4706f3a3e18390157a2a353536e.tar.gz/JSON-Marshal-0.0.24/t/140-opt-in.t:7
===> Testing [FAIL]: JSON::Marshal:ver<0.0.24>:auth<zef:jonathanstowe>:api<1.0>
Aborting due to test failure: JSON::Marshal:ver<0.0.24>:auth<zef:jonathanstowe>:api<1.0> (use --force-test to override)

I'm new to Raku, don't know how to further debug this issue.

Deprecated Code Warnings

Ran zef install Test::META and these messages scrolled by in the output:

===> Testing: JSON::Marshal:ver('0.0.9'):auth('github:jonathanstowe')
Testing with plugin: Zef::Shell::prove+{<anon|67806064>}
t/010-use.t ........ ok
t/020-marshal.t .... ok
t/030-trait.t ...... ok
t/040-json-name.t .. ok
t/050-skip-null.t .. ok
t/060-array.t ...... ok
All tests successful.
Files=6, Tests=28,  6 wallclock secs ( 0.03 usr  0.00 sys +  4.92 cusr  0.22 csys =  5.17 CPU)
Result: PASS
Saw 1 occurrence of deprecated code.
================================================================================
Sub from-json (from GLOBAL) seen at:
  t/020-marshal.t, line 27
Please use JSON::Fast, JSON::Tiny or JSON::Pretty from https://modules.perl6.org/ instead.
--------------------------------------------------------------------------------
Please contact the author to have these occurrences of deprecated code
adapted, so that this message will disappear!
Saw 1 occurrence of deprecated code.
================================================================================
Sub from-json (from GLOBAL) seen at:
  t/030-trait.t, lines 19,36
Please use JSON::Fast, JSON::Tiny or JSON::Pretty from https://modules.perl6.org/ instead.
--------------------------------------------------------------------------------
Please contact the author to have these occurrences of deprecated code
adapted, so that this message will disappear!
Saw 1 occurrence of deprecated code.
================================================================================
Sub from-json (from GLOBAL) seen at:
  t/040-json-name.t, line 23
Please use JSON::Fast, JSON::Tiny or JSON::Pretty from https://modules.perl6.org/ instead.
--------------------------------------------------------------------------------
Please contact the author to have these occurrences of deprecated code
adapted, so that this message will disappear!
Saw 1 occurrence of deprecated code.
================================================================================
Sub from-json (from GLOBAL) seen at:
  t/050-skip-null.t, lines 18,32
Please use JSON::Fast, JSON::Tiny or JSON::Pretty from https://modules.perl6.org/ instead.
--------------------------------------------------------------------------------
Please contact the author to have these occurrences of deprecated code
adapted, so that this message will disappear!
Saw 1 occurrence of deprecated code.
================================================================================
Sub from-json (from GLOBAL) seen at:
  t/060-array.t, line 18
Please use JSON::Fast, JSON::Tiny or JSON::Pretty from https://modules.perl6.org/ instead.
--------------------------------------------------------------------------------
Please contact the author to have these occurrences of deprecated code
adapted, so that this message will disappear!
===> Testing [OK] for JSON::Marshal:ver('0.0.9'):auth('github:jonathanstowe')
===> Testing: JSON::Unmarshal:ver('0.05')
Testing with plugin: Zef::Shell::prove+{<anon|67806064>}
t/any.t ........ ok
t/basic.t ...... ok
t/json-name.t .. ok
t/trait.t ...... ok
t/types.t ...... ok
All tests successful.
Files=5, Tests=49,  6 wallclock secs ( 0.03 usr  0.01 sys +  5.63 cusr  0.21 csys =  5.88 CPU)
Result: PASS

I'm on

This is Rakudo version 2016.04-200-gad82657 built on MoarVM version 2016.04-134-g9879233
implementing Perl 6.c.

Here's the entire output of the installation, if you need it:

zoffix@VirtualBox:~/CPANPRC/Terminal-Width$ zef install Test::META
===> Searching for: Test::META
===> Found: Test::META:ver('0.0.6'):auth('github:jonathanstowe')
===> Dependencies: Test, META6
===> Searching for missing dependencies: META6
===> Found dependencies: META6:ver('0.0.9'):auth('github:jonathanstowe')
===> Dependencies: JSON::Class, Test
===> Searching for missing dependencies: JSON::Class
===> Found dependencies: JSON::Class:ver('0.0.6'):auth('github:jonathanstowe')
===> Dependencies: JSON::Marshal, JSON::Unmarshal, Test
===> Searching for missing dependencies: JSON::Marshal, JSON::Unmarshal
===> Found dependencies: JSON::Unmarshal:ver('0.05'), JSON::Marshal:ver('0.0.9'):auth('github:jonathanstowe')
===> Dependencies: JSON::Fast, JSON::Name, Test
===> Searching for missing dependencies: JSON::Name
===> Found dependencies: JSON::Name:ver('0.0.2'):auth('github:jonathanstowe')
===> Dependencies: Test
===> Fetching: Test::META
Fetching with plugin: Zef::Shell::git+{<anon|67806064>}
===> Fetched: Test::META to /home/zoffix/.zef/tmp/Test-META.git
===> Extracting: Test::META
Extracting with plugin: Zef::Shell::git+{<anon|67806064>}
===> Extracted: Test::META to /home/zoffix/.zef/store/Test-META.git/162b8afb8de7f27456edffd978f422dab3b48e3c
===> Fetching: META6
Fetching with plugin: Zef::Shell::git+{<anon|67806064>}
===> Fetched: META6 to /home/zoffix/.zef/tmp/META6.git
===> Extracting: META6
Extracting with plugin: Zef::Shell::git+{<anon|67806064>}
===> Extracted: META6 to /home/zoffix/.zef/store/META6.git/31f5de4dd441985d7a684609a06269836dd93ed2
===> Fetching: JSON::Class
Fetching with plugin: Zef::Shell::git+{<anon|67806064>}
===> Fetched: JSON::Class to /home/zoffix/.zef/tmp/JSON-Class.git
===> Extracting: JSON::Class
Extracting with plugin: Zef::Shell::git+{<anon|67806064>}
===> Extracted: JSON::Class to /home/zoffix/.zef/store/JSON-Class.git/12a3de83bf68c21755c4e63a28af3a2ff2e7c009
===> Fetching: JSON::Unmarshal
Fetching with plugin: Zef::Shell::git+{<anon|67806064>}
===> Fetched: JSON::Unmarshal to /home/zoffix/.zef/tmp/JSON-Unmarshal.git
===> Extracting: JSON::Unmarshal
Extracting with plugin: Zef::Shell::git+{<anon|67806064>}
===> Extracted: JSON::Unmarshal to /home/zoffix/.zef/store/JSON-Unmarshal.git/97e3115683e82f44947506c172f73064126e2529
===> Fetching: JSON::Marshal
Fetching with plugin: Zef::Shell::git+{<anon|67806064>}
===> Fetched: JSON::Marshal to /home/zoffix/.zef/tmp/JSON-Marshal.git
===> Extracting: JSON::Marshal
Extracting with plugin: Zef::Shell::git+{<anon|67806064>}
===> Extracted: JSON::Marshal to /home/zoffix/.zef/store/JSON-Marshal.git/9ba165ebae50dd2d8bf9ffa5cd6c56eb1fabe998
===> Fetching: JSON::Name
Fetching with plugin: Zef::Shell::git+{<anon|67806064>}
===> Fetched: JSON::Name to /home/zoffix/.zef/tmp/JSON-Name.git
===> Extracting: JSON::Name
Extracting with plugin: Zef::Shell::git+{<anon|67806064>}
===> Extracted: JSON::Name to /home/zoffix/.zef/store/JSON-Name.git/888a6cb7b9e711d6b6f30cdc95c8f6a1a787ab03
===> Filtering: Test::META:ver('0.0.6'):auth('github:jonathanstowe')
===> Filtering [OK] for Test::META:ver('0.0.6'):auth('github:jonathanstowe')
===> Filtering: META6:ver('0.0.9'):auth('github:jonathanstowe')
===> Filtering [OK] for META6:ver('0.0.9'):auth('github:jonathanstowe')
===> Filtering: JSON::Class:ver('0.0.6'):auth('github:jonathanstowe')
===> Filtering [OK] for JSON::Class:ver('0.0.6'):auth('github:jonathanstowe')
===> Filtering: JSON::Unmarshal:ver('0.05')
===> Filtering [OK] for JSON::Unmarshal:ver('0.05')
===> Filtering: JSON::Marshal:ver('0.0.9'):auth('github:jonathanstowe')
===> Filtering [OK] for JSON::Marshal:ver('0.0.9'):auth('github:jonathanstowe')
===> Filtering: JSON::Name:ver('0.0.2'):auth('github:jonathanstowe')
===> Filtering [OK] for JSON::Name:ver('0.0.2'):auth('github:jonathanstowe')
===> # SKIP: No Build.pm for JSON::Name:ver('0.0.2'):auth('github:jonathanstowe')
===> # SKIP: No Build.pm for JSON::Marshal:ver('0.0.9'):auth('github:jonathanstowe')
===> # SKIP: No Build.pm for JSON::Unmarshal:ver('0.05')
===> # SKIP: No Build.pm for JSON::Class:ver('0.0.6'):auth('github:jonathanstowe')
===> # SKIP: No Build.pm for META6:ver('0.0.9'):auth('github:jonathanstowe')
===> # SKIP: No Build.pm for Test::META:ver('0.0.6'):auth('github:jonathanstowe')
===> Testing: JSON::Name:ver('0.0.2'):auth('github:jonathanstowe')
Testing with plugin: Zef::Shell::prove+{<anon|67806064>}
t/010-use.t .... ok
t/020-trait.t .. ok
All tests successful.
Files=2, Tests=4,  1 wallclock secs ( 0.02 usr  0.00 sys +  1.30 cusr  0.04 csys =  1.36 CPU)
Result: PASS
===> Testing [OK] for JSON::Name:ver('0.0.2'):auth('github:jonathanstowe')
===> Testing: JSON::Marshal:ver('0.0.9'):auth('github:jonathanstowe')
Testing with plugin: Zef::Shell::prove+{<anon|67806064>}
t/010-use.t ........ ok
t/020-marshal.t .... ok
t/030-trait.t ...... ok
t/040-json-name.t .. ok
t/050-skip-null.t .. ok
t/060-array.t ...... ok
All tests successful.
Files=6, Tests=28,  6 wallclock secs ( 0.03 usr  0.00 sys +  4.92 cusr  0.22 csys =  5.17 CPU)
Result: PASS
Saw 1 occurrence of deprecated code.
================================================================================
Sub from-json (from GLOBAL) seen at:
  t/020-marshal.t, line 27
Please use JSON::Fast, JSON::Tiny or JSON::Pretty from https://modules.perl6.org/ instead.
--------------------------------------------------------------------------------
Please contact the author to have these occurrences of deprecated code
adapted, so that this message will disappear!
Saw 1 occurrence of deprecated code.
================================================================================
Sub from-json (from GLOBAL) seen at:
  t/030-trait.t, lines 19,36
Please use JSON::Fast, JSON::Tiny or JSON::Pretty from https://modules.perl6.org/ instead.
--------------------------------------------------------------------------------
Please contact the author to have these occurrences of deprecated code
adapted, so that this message will disappear!
Saw 1 occurrence of deprecated code.
================================================================================
Sub from-json (from GLOBAL) seen at:
  t/040-json-name.t, line 23
Please use JSON::Fast, JSON::Tiny or JSON::Pretty from https://modules.perl6.org/ instead.
--------------------------------------------------------------------------------
Please contact the author to have these occurrences of deprecated code
adapted, so that this message will disappear!
Saw 1 occurrence of deprecated code.
================================================================================
Sub from-json (from GLOBAL) seen at:
  t/050-skip-null.t, lines 18,32
Please use JSON::Fast, JSON::Tiny or JSON::Pretty from https://modules.perl6.org/ instead.
--------------------------------------------------------------------------------
Please contact the author to have these occurrences of deprecated code
adapted, so that this message will disappear!
Saw 1 occurrence of deprecated code.
================================================================================
Sub from-json (from GLOBAL) seen at:
  t/060-array.t, line 18
Please use JSON::Fast, JSON::Tiny or JSON::Pretty from https://modules.perl6.org/ instead.
--------------------------------------------------------------------------------
Please contact the author to have these occurrences of deprecated code
adapted, so that this message will disappear!
===> Testing [OK] for JSON::Marshal:ver('0.0.9'):auth('github:jonathanstowe')
===> Testing: JSON::Unmarshal:ver('0.05')
Testing with plugin: Zef::Shell::prove+{<anon|67806064>}
t/any.t ........ ok
t/basic.t ...... ok
t/json-name.t .. ok
t/trait.t ...... ok
t/types.t ...... ok
All tests successful.
Files=5, Tests=49,  6 wallclock secs ( 0.03 usr  0.01 sys +  5.63 cusr  0.21 csys =  5.88 CPU)
Result: PASS
===> Testing [OK] for JSON::Unmarshal:ver('0.05')
===> Testing: JSON::Class:ver('0.0.6'):auth('github:jonathanstowe')
Testing with plugin: Zef::Shell::prove+{<anon|67806064>}
t/010-use.t ........ ok
t/030-roundtrip.t .. ok
t/040-traits.t ..... ok
t/050-array.t ...... ok
All tests successful.
Files=4, Tests=26,  7 wallclock secs ( 0.03 usr  0.00 sys +  6.28 cusr  0.24 csys =  6.55 CPU)
Result: PASS
Saw 1 occurrence of deprecated code.
================================================================================
Sub from-json (from GLOBAL) seen at:
  t/040-traits.t, line 18
Please use JSON::Fast, JSON::Tiny or JSON::Pretty from https://modules.perl6.org/ instead.
--------------------------------------------------------------------------------
Please contact the author to have these occurrences of deprecated code
adapted, so that this message will disappear!
===> Testing [OK] for JSON::Class:ver('0.0.6'):auth('github:jonathanstowe')
===> Testing: META6:ver('0.0.9'):auth('github:jonathanstowe')
Testing with plugin: Zef::Shell::prove+{<anon|67806064>}
t/010-use.t .......... ok
t/015-constructor.t .. ok
t/020-basic.t ........ ok
t/030-versions.t ..... ok
t/040-projects.t ..... ok
All tests successful.
Files=5, Tests=40, 22 wallclock secs ( 0.02 usr  0.01 sys + 20.64 cusr  0.52 csys = 21.19 CPU)
Result: PASS
Saw 1 occurrence of deprecated code.
================================================================================
Sub from-json (from GLOBAL) seen at:
  t/020-basic.t, line 25
Please use JSON::Fast, JSON::Tiny or JSON::Pretty from https://modules.perl6.org/ instead.
--------------------------------------------------------------------------------
Please contact the author to have these occurrences of deprecated code
adapted, so that this message will disappear!
===> Testing [OK] for META6:ver('0.0.9'):auth('github:jonathanstowe')
===> Testing: Test::META:ver('0.0.6'):auth('github:jonathanstowe')
Testing with plugin: Zef::Shell::prove+{<anon|67806064>}
t/010-use.t ........ ok
t/020-internals.t .. ok
t/030-my-meta.t .... ok
All tests successful.
Files=3, Tests=21, 12 wallclock secs ( 0.02 usr  0.00 sys + 10.77 cusr  0.26 csys = 11.05 CPU)
Result: PASS
===> Testing [OK] for Test::META:ver('0.0.6'):auth('github:jonathanstowe')
===> Installing: JSON::Name:ver('0.0.2'):auth('github:jonathanstowe')
===> Install [OK] for JSON::Name:ver('0.0.2'):auth('github:jonathanstowe')
===> Installing: JSON::Marshal:ver('0.0.9'):auth('github:jonathanstowe')
===> Install [OK] for JSON::Marshal:ver('0.0.9'):auth('github:jonathanstowe')
===> Installing: JSON::Unmarshal:ver('0.05')
===> Install [OK] for JSON::Unmarshal:ver('0.05')
===> Installing: JSON::Class:ver('0.0.6'):auth('github:jonathanstowe')
===> Install [OK] for JSON::Class:ver('0.0.6'):auth('github:jonathanstowe')
===> Installing: META6:ver('0.0.9'):auth('github:jonathanstowe')
===> Install [OK] for META6:ver('0.0.9'):auth('github:jonathanstowe')
===> Installing: Test::META:ver('0.0.6'):auth('github:jonathanstowe')
===> Install [OK] for Test::META:ver('0.0.6'):auth('github:jonathanstowe')
zoffix@VirtualBox:~/CPANPRC/Terminal-Width$ 

Test failing with wrong spacing in the expected value of tests

Trying to update to latest version with raku from latest master:


===> Testing: JSON::Marshal:ver<0.0.21>:auth<github:jonathanstowe>:api<1.0>
[JSON::Marshal] # Failed test 'marshalled JSON is compact'
[JSON::Marshal] # at t/120-pretty.t line 37
[JSON::Marshal] # expected: "\{\"bool\":true,\"int\":42,\"str-array\":[\"one\",\"two\",\"three\"],\"string\":\"string\"}"
[JSON::Marshal] #      got: "\{\"bool\": true,\"int\": 42,\"str-array\": [\"one\",\"two\",\"three\"],\"string\": \"string\"}"
[JSON::Marshal] # You failed 1 test of 4
===> Testing [FAIL]: JSON::Marshal:ver<0.0.21>:auth<github:jonathanstowe>:api<1.0>
Aborting due to test failure: JSON::Marshal:ver<0.0.21>:auth<github:jonathanstowe>:api<1.0> (use --force-test to override)

Regards!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.