File: ordering.t

package info (click to toggle)
libtest-spec-perl 0.54-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 308 kB
  • sloc: perl: 2,502; makefile: 2
file content (25 lines) | stat: -rwxr-xr-x 503 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/env perl
#
# ordering.pl
#
# Verify that describe blocks are executed in order of definition.
#
########################################################################
#

use Test::Spec;
use FindBin qw($Bin);
BEGIN { require "$Bin/test_helper.pl" };

my $num_contexts = 10;

my $next_expected = 1;
for my $num (1..$num_contexts) {
  describe "Context $num" => sub {
    it "should run in position $num" => sub {
      is $next_expected++, $num;
    };
  }
};

runtests(@ARGV) unless caller;