Parse and store javadoc-style docstrings at toplevel
[kaos.git] / t / 10targ.t
blob5f4d39a22423a4f19349e9b0923ee37d42853527
1 #!/usr/bin/perl
2 use strict;
3 use warnings;
5 use Test::Kaos;
6 plan tests => 5;
8 test_output("Production and folding from targ", q{
9 kill(newsimple(1,2,3, "foo", 4, 5, 6));
10 }, q{
11 NEW: SIMP 1 2 3 "foo" 4 5 6
12 KILL TARG
13 RSCR
14 });
16 test_output("Multiple production from targ", q{
17 agent x = newsimple(1,2,3, "foo", 4, 5, 6);
18 agent y = newsimple(1,2,3, "foo", 4, 5, 6);
19 kill(x);
20 kill(y);
21 }, q{
22 NEW: SIMP 1 2 3 "foo" 4 5 6
23 SETA $1 TARG
24 NEW: SIMP 1 2 3 "foo" 4 5 6
25 SETA $2 TARG
26 KILL $1
27 KILL $2
28 RSCR
29 });
31 test_output("Setting targ (and folding within)", q{
32 print(null.unid);
33 }, q{
34 TARG NULL
35 OUTV UNID
36 RSCR
37 });
39 test_output("Setting targ (multiple contexts; partial folding)", q{
40 numeric a = null.unid;
41 numeric b = norn.unid;
42 print(a);
43 print(b);
44 }, q{
45 TARG NULL
46 SETV $1 UNID
47 TARG NORN
48 SETV $2 UNID
49 OUTV $1
50 OUTV $2
51 RSCR
52 });
54 test_output("Setting targ (invalidation; no folding)", q{
55 numeric a = norn.unid;
56 kill(norn);
57 print (a);
58 }, q{
59 TARG NORN
60 SETV $1 UNID
61 KILL NORN
62 OUTV $1
63 RSCR
64 });