nus-oss-test / testrepo4

TEAMMATES system is online at
http://teammatesv4.appspot.com
0 stars 0 forks source link

Write a test method for testing regex #1662

Closed damithc closed 10 years ago

damithc commented 10 years ago

From dam...@gmail.com on February 06, 2014 07:41:32

something like this: isMatching(regex, string): boolean

This can be used for testing regex correctness.

Can be in string helper?

Original issue: http://code.google.com/p/teammatespes/issues/detail?id=1590

damithc commented 10 years ago

From OTS.Nexus on February 06, 2014 04:56:20

Actually String class itself already got an instance method which checks whether the string matches a given regex. matches(regex) : boolean

Just that for the case where it involves characters with diacritics (like é, à), we have to use the CANON_EQ flag to enable canonical equivalence checking as below: Pattern.compile(regex, Pattern.CANON_EQ).matcher(value).matches();

So we are going to create a higher level method to execute the above combined statements?

damithc commented 10 years ago

From dam...@gmail.com on February 06, 2014 05:21:00

Can create a higher level method. What happens if you use the flag for all cases? Will that work?

damithc commented 10 years ago

From OTS.Nexus on February 06, 2014 21:10:30

Supposed to be ok. Although the API mentions that using the flag may impose a performance penalty, it might not affect us a lot i think since we are not validating any extremely long string. http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html#CANON_EQ

damithc commented 10 years ago

From dam...@gmail.com on February 06, 2014 21:23:32

OK, we can try that. Just add a comment to say that the method may be slower than necessary.

damithc commented 10 years ago

From OTS.Nexus on February 06, 2014 22:07:05

Owner: OTS.Nexus

damithc commented 10 years ago

From OTS.Nexus on February 12, 2014 03:08:11

ReadyForReview: https://codereview.appspot.com/61510050/ Comments explaining the regex were changed to Javadoc comment for easier reference

Status: ReadyForReview

damithc commented 10 years ago

From dam...@gmail.com on February 12, 2014 18:55:05

Status: ReadyToMerge

damithc commented 10 years ago

From OTS.Nexus on February 13, 2014 05:48:38

This issue was updated by revision d582e2c32b94 .

damithc commented 10 years ago

From OTS.Nexus on February 13, 2014 05:49:17

Status: Delivered

damithc commented 10 years ago

From dam...@gmail.com on February 14, 2014 07:46:26

Did you get dev green for this? This may be the cause for recent test failures.

damithc commented 10 years ago

From OTS.Nexus on February 14, 2014 07:59:17

The bug mentioned by Arnold? When i ran the test in dev server before merging with the default branch it seems ok. I am checking for it now.

damithc commented 10 years ago

From OTS.Nexus on February 14, 2014 08:24:12

It is the change of the regex testing method inside one of the method of AssertHelper class which causes the bug. It is a small change i made after running the all test suite. My fault for not re-running the whole test again.

Status: Started

damithc commented 10 years ago

From OTS.Nexus on February 14, 2014 08:26:07

This issue was updated by revision 76cd8f35d97f .

damithc commented 10 years ago

From OTS.Nexus on February 14, 2014 08:28:30

Status: Delivered

damithc commented 10 years ago

From dam...@gmail.com on February 14, 2014 19:02:37

Status: Deployed
Labels: Milestone-V4.87

damithc commented 10 years ago

From OTS.Nexus on February 26, 2014 01:58:32

This issue was updated by revision d582e2c32b94 .

damithc commented 10 years ago

From OTS.Nexus on February 26, 2014 01:58:33

This issue was updated by revision 76cd8f35d97f .