logo

ap-client

CLI-based client / toolbox for ActivityPub Client-to-Servergit clone https://anongit.hacktivis.me/git/ap-client.git/

pleroma.t (705B)


  1. #!/usr/bin/env perl
  2. # AP-Client: CLI-based client / toolbox for ActivityPub
  3. # Copyright © 2020-2023 AP-Client Authors <https://hacktivis.me/git/ap-client/>
  4. # SPDX-License-Identifier: BSD-3-Clause
  5. use strict;
  6. use utf8;
  7. use open ":std", ":encoding(UTF-8)";
  8. use Test::More tests => 1;
  9. use Test::Output;
  10. use JSON;
  11. use App::ActivityPubClient qw(print_object);
  12. # Read whole files
  13. undef $/;
  14. open(USER_JSON, '<:raw', 't/pleroma_user.json') or die "$!";
  15. my $object = decode_json(<USER_JSON>) or die "$!";
  16. close(USER_JSON);
  17. open(USER_TXT, '<:encoding(UTF-8)', 't/pleroma_user.out') or die "$!";
  18. output_is(sub { print_object(1, $object) }, <USER_TXT>, '', 'Test printing pleroma user');
  19. close(USER_TXT);