Skip to content

Add test cases from perl# 3516 (\G with /g) #10511

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
p5pRT opened this issue Jul 25, 2010 · 5 comments
Closed

Add test cases from perl# 3516 (\G with /g) #10511

p5pRT opened this issue Jul 25, 2010 · 5 comments

Comments

@p5pRT
Copy link

p5pRT commented Jul 25, 2010

Migrated from rt.perl.org#76706 (status was 'resolved')

Searchable as RT76706$

@p5pRT
Copy link
Author

p5pRT commented Jul 25, 2010

From @greerga

Three test cases were included with #3516 and should be added to the
test suite. A "git bisect"-able version is attached, which is what I used
to track down the fixing commit.

--
George Greer

@p5pRT
Copy link
Author

p5pRT commented Jul 25, 2010

From @greerga

#!/usr/bin/perl
my $count_1 = 0;
while ("abc" =~ m/(\G[ac])?/g) {
  fail() if $count_1++ > 10;
# print "$count_1​: have [$&]\n";
}
my $count_2 = 0;
while ("abc" =~ m/(\G|.)[ac]/g) {
  fail() if $count_2++ > 10;
# print "$count_2​: have [$&]\n";
}
my $count_3 = 0;
while ("abc" =~ m/(\G?[ac])?/g) {
  fail() if $count_3++ > 10;
# print "$count_3​: have [$&]\n";
}
success();

# For git bisect this is backwards
sub fail { exit 0; }
sub success { exit 1; }

@p5pRT
Copy link
Author

p5pRT commented Jul 25, 2010

@gannett-ggreer - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Jan 27, 2011

From @iabyn

On Sat, Jul 24, 2010 at 08​:06​:08PM -0700, George Greer wrote​:

Three test cases were included with #3516 and should be added to the
test suite. A "git bisect"-able version is attached, which is what I used
to track down the fixing commit.

Tests added with commit 99ca48e

--
Atheism is a religion like not collecting stamps is a hobby

@p5pRT
Copy link
Author

p5pRT commented Jan 27, 2011

@iabyn - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant