File: 33props-set.t

package info (click to toggle)
libtangence-perl 0.33-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 580 kB
  • sloc: perl: 6,076; makefile: 15
file content (55 lines) | stat: -rw-r--r-- 962 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
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/perl

use v5.26;
use warnings;

use Future::AsyncAwait 0.47;

use Test2::V0;

use Tangence::Registry;

use lib ".";
use t::TestObj;
use t::TestServerClient;

my $registry = Tangence::Registry->new(
   tanfile => "t/TestObj.tan",
);
my $obj = $registry->construct(
   "t::TestObj",
);

my ( $server, $client ) = make_serverclient( $registry );

my $proxy = $client->rootobj;

# scalar
{
   await $proxy->set_property( "scalar", 456 );

   is( $obj->get_prop_scalar, 456, 'set_property on scalar' );
}

# array
{
   await $proxy->set_property( "array", [ 4, 5, 6 ] );

   is( $obj->get_prop_array, [ 4, 5, 6 ], 'set_property on array' );
}

# queue
{
   await $proxy->set_property( "queue", [ 4, 5, 6 ] );

   is( $obj->get_prop_queue, [ 4, 5, 6 ], 'set_property on queue' );
}

# hash
{
   await $proxy->set_property( "hash", { four => 4, five => 5 } );

   is( $obj->get_prop_hash, { four => 4, five => 5 }, 'set_property on hash' );
}

done_testing;