Skip to content
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

Use registered patterns after sorting by length #20

Merged
merged 2 commits into from Nov 8, 2018

Conversation

papix
Copy link
Member

@papix papix commented Nov 7, 2018

No description provided.

@@ -12,7 +12,7 @@ sub new {

sub intercept {
my ($self, $uri, $env, $req) = @_;
for my $pattern (keys %{ $self->{registry} }) {
for my $pattern (sort { length $a <=> length $b } keys %{ $self->{registry} }) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add some tests?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙇 I added tests: fff84e8

@astj astj merged commit c11c944 into hatena:master Nov 8, 2018
astj added a commit that referenced this pull request Nov 8, 2018
Changelog diff is:

diff --git a/Changes b/Changes
index d6fabfa..5cdbc3d 100644
--- a/Changes
+++ b/Changes
@@ -1,6 +1,8 @@
 Revision history for Perl extension Test-WWW-Stub

 {{$NEXT}}
+
+0.08 2018-11-08T03:04:13Z
     - Use registered patterns after sorting by length, to deal with hash randomization. (#20, thanks to papix)

 0.07 2017-03-14T01:52:26Z
@papix papix deleted the sort-registered-patterns branch December 17, 2018 05:33
astj added a commit that referenced this pull request Mar 7, 2019
Changelog diff is:

diff --git a/Changes b/Changes
index 5cdbc3d..1079c68 100644
--- a/Changes
+++ b/Changes
@@ -2,6 +2,9 @@ Revision history for Perl extension Test-WWW-Stub

 {{$NEXT}}

+0.09 2019-03-07T07:06:34Z
+    - Restore to proper state when localize guard object has released in a different order (#21)
+
 0.08 2018-11-08T03:04:13Z
     - Use registered patterns after sorting by length, to deal with hash randomization. (#20, thanks to papix)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants