[Rt-commit] [rtir] 01/03: Switch from `each` to `sort keys` so tests run in the same order

Shawn Moore shawn at bestpractical.com
Tue Feb 23 19:46:46 EST 2016


This is an automated email from the git hooks/post-receive script.

shawn pushed a commit to branch 3.4/test-fail-ipv6
in repository rtir.

commit 5c37b33881b41198f7c190c9d00d2b4495458f01
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Wed Feb 24 00:06:07 2016 +0000

    Switch from `each` to `sort keys` so tests run in the same order
---
 t/custom-fields/ipv6.t | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/t/custom-fields/ipv6.t b/t/custom-fields/ipv6.t
index b5a2aad..efb51db 100644
--- a/t/custom-fields/ipv6.t
+++ b/t/custom-fields/ipv6.t
@@ -58,7 +58,8 @@ diag "check that CF applies to all RTIR's queues" if $ENV{'TEST_VERBOSE'};
 my $rtir_user = RT::CurrentUser->new( rtir_user() );
 
 diag "create a ticket via web and set IP" if $ENV{'TEST_VERBOSE'};
-while ( my ($short, $full) = each %valid ) {
+for my $short (sort keys %valid) {
+    my $full = $valid{$short};
     my $incident_id; # block couldn't be created without incident id
     foreach my $queue( 'Incidents', 'Incident Reports', 'Investigations', 'Blocks' ) {
         diag "create a ticket in the '$queue' queue" if $ENV{'TEST_VERBOSE'};
@@ -83,7 +84,8 @@ while ( my ($short, $full) = each %valid ) {
 }
 
 diag "create a ticket via web with IP in message" if $ENV{'TEST_VERBOSE'};
-while ( my ($short, $full) = each %test_set ) {
+for my $short (sort keys %test_set) {
+    my $full = $valid{$short};
     my $incident_id; # block couldn't be created without incident id
     foreach my $queue( 'Incidents', 'Incident Reports', 'Investigations', 'Blocks' ) {
         diag "create a ticket in the '$queue' queue" if $ENV{'TEST_VERBOSE'};
@@ -108,7 +110,8 @@ while ( my ($short, $full) = each %test_set ) {
 }
 
 diag "create a ticket via web with CIDR" if $ENV{'TEST_VERBOSE'};
-while ( my ($short, $full) = each %test_cidr ) {
+for my $short (sort keys %test_cidr) {
+    my $full = $test_cidr{$short};
     my $incident_id; # block couldn't be created without incident id
     foreach my $queue( 'Incidents', 'Incident Reports', 'Investigations', 'Blocks' ) {
         diag "create a ticket in the '$queue' queue" if $ENV{'TEST_VERBOSE'};
@@ -136,7 +139,8 @@ while ( my ($short, $full) = each %test_cidr ) {
 }
 
 diag "create a ticket via web with CIDR in message" if $ENV{'TEST_VERBOSE'};
-while ( my ($short, $full) = each %test_cidr ) {
+for my $short (sort keys %test_cidr) {
+    my $full = $test_cidr{$short};
     my $incident_id; # block couldn't be created without incident id
     foreach my $queue( 'Incidents', 'Incident Reports', 'Investigations', 'Blocks' ) {
         diag "create a ticket in the '$queue' queue" if $ENV{'TEST_VERBOSE'};

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the rt-commit mailing list