-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[master] tests for setf-move-init and setf-move-assign (#43)
- Loading branch information
Showing
2 changed files
with
73 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/usr/bin/perl | ||
|
||
use warnings; | ||
use strict; | ||
$ENV{"DALE_TEST_ARGS"} ||= ""; | ||
my $test_dir = $ENV{"DALE_TEST_DIR"} || "."; | ||
$ENV{PATH} .= ":."; | ||
|
||
use Data::Dumper; | ||
use Test::More tests => 4; | ||
|
||
my @res = `dalec $ENV{"DALE_TEST_ARGS"} $test_dir/t/src/rv-refs-setf-move.dt -o rv-refs-setf-move`; | ||
is(@res, 4, 'Four compilation statements'); | ||
chomp for @res; | ||
is_deeply(\@res, [ | ||
'setf-copy-init', | ||
'setf-copy-assign', | ||
'setf-move-assign', | ||
'setf-move-assign', | ||
], 'Got expected results'); | ||
|
||
@res = `./rv-refs-setf-move`; | ||
is($?, 0, 'Program executed successfully'); | ||
|
||
chomp for @res; | ||
|
||
is_deeply(\@res, [ | ||
'Previously: two setf-move-inits', | ||
'One setf-move-init', | ||
'setf-move-init', | ||
'One setf-move-assign', | ||
'setf-move-assign', | ||
'One setf-move-init', | ||
'setf-move-init', | ||
'Two setf-move-inits', | ||
'setf-move-init', | ||
'setf-move-init', | ||
'Preswap', | ||
'1 2', | ||
'1 3', | ||
'setf-move-init', | ||
'setf-move-assign', | ||
'setf-move-assign', | ||
'Postswap', | ||
'1 3', | ||
'1 2', | ||
], 'Got expected results'); | ||
|
||
`rm rv-refs-setf-move`; | ||
|
||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters