File: unit-multi.t

package info (click to toggle)
libtest-fitesque-rdf-perl 0.100-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 320 kB
  • sloc: perl: 243; makefile: 4
file content (82 lines) | stat: -rw-r--r-- 1,471 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
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
=pod

=encoding utf-8

=head1 PURPOSE

Unit test that Test::FITesque::RDF transforms data correctly from RDF with multiple tests and multiple parameters

=head1 AUTHOR

Kjetil Kjernsmo E<lt>kjetilk@cpan.orgE<gt>.

=head1 COPYRIGHT AND LICENCE

This software is Copyright (c) 2019 by Inrupt Inc.

This is free software, licensed under:

  The MIT (X11) License


=cut

use strict;
use warnings;
use Test::More;
use Test::Deep;
use FindBin qw($Bin);


my $file = $Bin . '/data/multi.ttl';


use_ok('Test::FITesque::RDF');
my $t = Test::FITesque::RDF->new(source => $file);

my $data = $t->transform_rdf;

my $multi = [
				 [
				  'Internal::Fixture::Multi'
				 ],
				 [
				  'multiplication',
				  {
					'-special' => { 'description' => 'Multiply two numbers' },
					'factor1' => '6',
					'product' => '42',
					'factor2' => '7'
				  }
				 ]
				];
my $simple = [
				  [
					'Internal::Fixture::Simple'
				  ],
				  [
					'string_found',
					{
                '-special' => { 'description' => 'Echo a string' },
					 'all' => 'counter-clockwise dahut'
					}
				  ]
				 ];
my $nobase = [
				  [
					'Internal::Fixture::Simple'
				  ],
				  [
					'string_found_long',
					{
                '-special' => { 'description' => 'Run with no param_base' },
					 'http://example.org/my-parameters#all' => 'counter-clockwise dahut'
					}
				  ]
				 ];

cmp_deeply($data, bag($multi, $simple, $nobase), 'Compare the data structures');


done_testing;