From 605ed02fc4c597f34aaecebdb9f2de3c3f29893e Mon Sep 17 00:00:00 2001 From: Rocky Bernstein Date: Fri, 17 Feb 2012 15:18:57 -0500 Subject: [PATCH] Add test for "next" bug just fixed --- example/next2.pl | 11 +++++++++++ t/20test-next2.t | 8 ++++++++ t/data/next2.cmd | 6 ++++++ t/data/next2.right | 6 ++++++ 4 files changed, 31 insertions(+) create mode 100644 example/next2.pl create mode 100755 t/20test-next2.t create mode 100644 t/data/next2.cmd create mode 100644 t/data/next2.right diff --git a/example/next2.pl b/example/next2.pl new file mode 100644 index 0000000..906be02 --- /dev/null +++ b/example/next2.pl @@ -0,0 +1,11 @@ +#!/usr/bin/env perl +use strict; use warnings; +use vars qw($version $program); +sub init(); +init(); +my $y=3; +sub init() { + use File::Basename; + $program = basename($0); # Who am I today, anyway? + $version='1.0'; +} diff --git a/t/20test-next2.t b/t/20test-next2.t new file mode 100755 index 0000000..9bdd57e --- /dev/null +++ b/t/20test-next2.t @@ -0,0 +1,8 @@ +#!/usr/bin/env perl +use warnings; use strict; +use Test::More 'no_plan'; +use rlib '.'; +use Helper; +my $test_prog = File::Spec->catfile(dirname(__FILE__), + qw(.. example next2.pl)); +Helper::run_debugger("$test_prog", 'next2.cmd'); diff --git a/t/data/next2.cmd b/t/data/next2.cmd new file mode 100644 index 0000000..293f1a1 --- /dev/null +++ b/t/data/next2.cmd @@ -0,0 +1,6 @@ +# test of another bug we once had with the "next" command. +# Use this with example/next2.pl +next +p $program +p $version + diff --git a/t/data/next2.right b/t/data/next2.right new file mode 100644 index 0000000..ec17312 --- /dev/null +++ b/t/data/next2.right @@ -0,0 +1,6 @@ +-- (next2.pl:5) +init(); +-- (next2.pl:6) +my $y=3; +$DB::D[0] = 'trepan.pl' +$DB::D[1] = '1.0'