Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(11490)

Issue 103180043: Fix a bug with the postal code validator where a pattern with a "|" can match any part of a postal …

Can't Edit
Can't Publish+Mail
Start Review
Created:
9 years, 11 months ago by davinci_google
Modified:
9 years, 10 months ago
Reviewers:
lararennie
Base URL:
http://libaddressinput.googlecode.com/svn/trunk/cpp/
Visibility:
Public.

Description

Fix a bug with the postal code validator where a pattern with a "|" can match any part of a postal code, when it is intended to match only the prefix.

Patch Set 1 : #

Total comments: 1

Patch Set 2 : store and expose default postal code directly #

Total comments: 4

Patch Set 3 : rename GetDefaultPostalCode to GetSolePostalCode #

Total comments: 1

Patch Set 4 : add unit test for sole postal code #

Unified diffs Side-by-side diffs Delta from patch set Stats (+57 lines, -17 lines) Patch
M cpp/src/address_input_helper.cc View 1 2 2 chunks +1 line, -16 lines 0 comments Download
M cpp/src/rule.h View 1 2 2 chunks +6 lines, -0 lines 0 comments Download
M cpp/src/rule.cc View 1 2 3 5 chunks +17 lines, -1 line 0 comments Download
M cpp/test/rule_test.cc View 1 2 3 4 chunks +19 lines, -0 lines 0 comments Download
M cpp/test/validation_task_test.cc View 1 1 chunk +14 lines, -0 lines 0 comments Download

Messages

Total messages: 7
davinci_google
9 years, 11 months ago (2014-06-06 11:03:26 UTC) #1
lararennie
https://codereview.appspot.com/103180043/diff/20001/src/address_input_helper.cc File src/address_input_helper.cc (right): https://codereview.appspot.com/103180043/diff/20001/src/address_input_helper.cc#newcode139 src/address_input_helper.cc:139: // TODO: Modify the rule class to store and ...
9 years, 11 months ago (2014-06-06 11:14:26 UTC) #2
davinci_google
On 2014/06/06 11:14:26, lararennie wrote: > https://codereview.appspot.com/103180043/diff/20001/src/address_input_helper.cc > File src/address_input_helper.cc (right): > > https://codereview.appspot.com/103180043/diff/20001/src/address_input_helper.cc#newcode139 > ...
9 years, 10 months ago (2014-06-13 08:51:24 UTC) #3
lararennie
https://codereview.appspot.com/103180043/diff/40001/cpp/src/address_input_helper.cc File cpp/src/address_input_helper.cc (right): https://codereview.appspot.com/103180043/diff/40001/cpp/src/address_input_helper.cc#newcode130 cpp/src/address_input_helper.cc:130: if (!default_postal_code.empty()) { You could just do this unconditionally, ...
9 years, 10 months ago (2014-06-13 09:17:23 UTC) #4
davinci_google
https://codereview.appspot.com/103180043/diff/40001/cpp/src/address_input_helper.cc File cpp/src/address_input_helper.cc (right): https://codereview.appspot.com/103180043/diff/40001/cpp/src/address_input_helper.cc#newcode130 cpp/src/address_input_helper.cc:130: if (!default_postal_code.empty()) { On 2014/06/13 09:17:23, lararennie wrote: > ...
9 years, 10 months ago (2014-06-13 14:42:55 UTC) #5
lararennie
LGTM https://codereview.appspot.com/103180043/diff/80001/cpp/src/rule.cc File cpp/src/rule.cc (right): https://codereview.appspot.com/103180043/diff/80001/cpp/src/rule.cc#newcode232 cpp/src/rule.cc:232: // If the "zip" field is not a ...
9 years, 10 months ago (2014-06-13 14:56:32 UTC) #6
davinci_google
9 years, 10 months ago (2014-06-13 15:57:45 UTC) #7
On 2014/06/13 14:56:32, lararennie wrote:
> LGTM
> 
> https://codereview.appspot.com/103180043/diff/80001/cpp/src/rule.cc
> File cpp/src/rule.cc (right):
> 
> https://codereview.appspot.com/103180043/diff/80001/cpp/src/rule.cc#newcode232
> cpp/src/rule.cc:232: // If the "zip" field is not a regular expression, then
it
> is the sole
> I think a unit test would also be worthwhile.

Done.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b