Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
180 additions
and
0 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,57 @@ | ||
use v6; | ||
use Test; | ||
|
||
plan 13; | ||
|
||
my $dir = 't/spec/S24-testing/test-data/'; | ||
my $prefix = 'line-number-'; | ||
my $suffix = '.txt'; | ||
|
||
my $cmd; | ||
my $full-path; | ||
|
||
sub execute-test ( :$function, :$line ) { | ||
$full-path = $dir ~ $prefix ~ $function ~ $suffix; | ||
$cmd = "$*EXECUTABLE $full-path 2>&1"; | ||
ok qqx[$cmd] ~~ /'Failed test ' (\N* \n \N*)? 'at ' $full-path ' line ' $line/, | ||
"failing test with $function reports correct line number $line"; | ||
} | ||
|
||
#?DOES 1 | ||
execute-test(:function("cmp_ok"), :line(9)); | ||
|
||
#?DOES 1 | ||
execute-test(:function("dies_ok"), :line(9)); | ||
|
||
#?DOES 1 | ||
execute-test(:function("eval_dies_ok"), :line(9)); | ||
|
||
#?DOES 1 | ||
execute-test(:function("eval_lives_ok"), :line(9)); | ||
|
||
#?DOES 1 | ||
execute-test(:function("isa_ok"), :line(9)); | ||
|
||
#?DOES 1 | ||
execute-test(:function("is_approx"), :line(9)); | ||
|
||
#?DOES 1 | ||
execute-test(:function("is_deeply"), :line(9)); | ||
|
||
#?DOES 1 | ||
execute-test(:function("isnt"), :line(9)); | ||
|
||
#?DOES 1 | ||
execute-test(:function("is"), :line(9)); | ||
|
||
#?DOES 1 | ||
execute-test(:function("lives_ok"), :line(9)); | ||
|
||
#?DOES 1 | ||
execute-test(:function("nok"), :line(9)); | ||
|
||
#?DOES 1 | ||
execute-test(:function("ok"), :line(9)); | ||
|
||
#?DOES 1 | ||
execute-test(:function("throws_like"), :line(9)); |
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,6 @@ | ||
t/spec/S24-testing/test-data/README | ||
|
||
This directory exists to hold files which are used | ||
by tests in S24-testing. | ||
The files in this directorey are not supposed to | ||
be run directly. |
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,9 @@ | ||
use v6; | ||
use Test; | ||
|
||
plan 1; | ||
|
||
## the following code should stay at line number 9 | ||
## if you move it to another line, please adjust | ||
## the line number in S24-testing/line-numbers.t | ||
cmp_ok 'foo', 'eq', 'bar'; |
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,9 @@ | ||
use v6; | ||
use Test; | ||
|
||
plan 1; | ||
|
||
## the following code should stay at line number 9 | ||
## if you move it to another line, please adjust | ||
## the line number in S24-testing/line-numbers.t | ||
dies_ok { 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
use v6; | ||
use Test; | ||
|
||
plan 1; | ||
|
||
## the following code should stay at line number 9 | ||
## if you move it to another line, please adjust | ||
## the line number in S24-testing/line-numbers.t | ||
eval_dies_ok '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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
use v6; | ||
use Test; | ||
|
||
plan 1; | ||
|
||
## the following code should stay at line number 9 | ||
## if you move it to another line, please adjust | ||
## the line number in S24-testing/line-numbers.t | ||
eval_lives_ok 'die'; |
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,9 @@ | ||
use v6; | ||
use Test; | ||
|
||
plan 1; | ||
|
||
## the following code should stay at line number 9 | ||
## if you move it to another line, please adjust | ||
## the line number in S24-testing/line-numbers.t | ||
is 'foo', 'bar'; |
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,9 @@ | ||
use v6; | ||
use Test; | ||
|
||
plan 1; | ||
|
||
## the following code should stay at line number 9 | ||
## if you move it to another line, please adjust | ||
## the line number in S24-testing/line-numbers.t | ||
is_approx 1, 2; |
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,9 @@ | ||
use v6; | ||
use Test; | ||
|
||
plan 1; | ||
|
||
## the following code should stay at line number 9 | ||
## if you move it to another line, please adjust | ||
## the line number in S24-testing/line-numbers.t | ||
is_deeply <foo bar>, <baz>; |
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,9 @@ | ||
use v6; | ||
use Test; | ||
|
||
plan 1; | ||
|
||
## the following code should stay at line number 9 | ||
## if you move it to another line, please adjust | ||
## the line number in S24-testing/line-numbers.t | ||
isa_ok Str, Num; |
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,9 @@ | ||
use v6; | ||
use Test; | ||
|
||
plan 1; | ||
|
||
## the following code should stay at line number 9 | ||
## if you move it to another line, please adjust | ||
## the line number in S24-testing/line-numbers.t | ||
isnt 'foo', 'foo'; |
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,9 @@ | ||
use v6; | ||
use Test; | ||
|
||
plan 1; | ||
|
||
## the following code should stay at line number 9 | ||
## if you move it to another line, please adjust | ||
## the line number in S24-testing/line-numbers.t | ||
lives_ok { die }; |
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,9 @@ | ||
use v6; | ||
use Test; | ||
|
||
plan 1; | ||
|
||
## the following code should stay at line number 9 | ||
## if you move it to another line, please adjust | ||
## the line number in S24-testing/line-numbers.t | ||
nok 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
use v6; | ||
use Test; | ||
|
||
plan 1; | ||
|
||
## the following code should stay at line number 9 | ||
## if you move it to another line, please adjust | ||
## the line number in S24-testing/line-numbers.t | ||
ok 0; |
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,9 @@ | ||
use v6; | ||
use Test; | ||
|
||
plan 1; | ||
|
||
## the following code should stay at line number 9 | ||
## if you move it to another line, please adjust | ||
## the line number in S24-testing/line-numbers.t | ||
throws_like { X::Syntax::Confused }, X::AdHoc; |