1# -*- perl -*- 2 3use strict; 4use Set::IntSpan 1.17; 5 6my $N = 1; 7sub Not { print "not " } 8sub OK { print "ok ", $N++, "\n" } 9 10print "1..4\n"; 11print "#real_set\n"; 12 13my $set = new Set::IntSpan; 14my $set_1 = union $set; 15my $run_list_1 = run_list $set_1; 16 17print "#real_set: union set -> $run_list_1\n"; 18empty $set_1 or Not; OK; 19 20my $set_2 = union $set "1-5,8-9"; 21my $set_3 = union $set $set_2; 22my $set_4 = union $set +[1, 5, 2, 8, 9, 1, 3, 4, 9]; 23 24my $run_list_2 = run_list $set_2; 25my $run_list_3 = run_list $set_3; 26my $run_list_4 = run_list $set_4; 27 28print "#real_set: $run_list_2 -> $run_list_3\n"; 29$set_2->equal($set_3) or Not; OK; 30 31print "#real_set: $run_list_2 -> $run_list_4\n"; 32$set_2->equal($set_4) or Not; OK; 33 34my $set_5 = union $set "0"; 35my $run_list_5 = run_list $set_5; 36print "#real_set: $run_list_5 -> 0\n"; 37$run_list_5 eq "0" or Not; OK; 38