summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-02-23 11:06:46 +0000
committerNicholas Clark <nick@ccl4.org>2011-02-23 11:06:46 +0000
commita552ba59669ed0172db3240722c573b7ce317e7b (patch)
tree42133b0b8e0c810f17cd03d7dcb81d7f1bd258f9 /t
parentc8c139910f0949c2e0a1fa2819c15d4c834fa5cd (diff)
downloadperl-a552ba59669ed0172db3240722c573b7ce317e7b.tar.gz
Test that perl.c reports {non_,}bincompat_options in sorted order.
Whilst the actual order doesn't matter semantically, ensuring that they are always in a sorted order means that string comparison can be used to validate that two sets of options are identical. This will be useful in the near future for improved load-time extension compatibility checking.
Diffstat (limited to 't')
-rw-r--r--t/porting/bincompat.t18
1 files changed, 18 insertions, 0 deletions
diff --git a/t/porting/bincompat.t b/t/porting/bincompat.t
new file mode 100644
index 0000000000..f65fe3782f
--- /dev/null
+++ b/t/porting/bincompat.t
@@ -0,0 +1,18 @@
+#!./perl -w
+use strict;
+require './test.pl';
+
+use Config;
+
+plan(2);
+
+# Defiantely a white box test...
+
+# As we need to call it direct, we'll take advantage of its result ordering:
+my @to_check = qw(bincompat_options non_bincompat_options);
+my @V = map {s/^ //r} Internals::V();
+
+while (my ($index, $sub) = each @to_check) {
+ my $got = join ' ', &{Config->can($sub)}();
+ is($got, $V[$index], "C source code has $sub in sorted order");
+}