These are combinations of input value that tend to trigger corner cases more often.
Use them in your unit and integration tests.
Expression | Actual result |
---|---|
1000000000 + 2000000000 | -1294967296 |
0.01 + 0.09 | 0.09999999999999999 |
0.01 + 0.05 | 0.060000000000000005 |
0.01 + 0.02 + 0.03 | 0.06 |
0.03 + 0.02 + 0.01 | 0.060000000000000005 |
(double) 9007199254740993L | 9007199254740992.0 |
9007199254740992.0 + 1.0 | 9007199254740992.0 |
9007199254740992.0 + 3.0 | 9007199254740996.0 |
String | Why |
---|---|
Allô (French telephone hello) | ISO 8859-1 |
€ (euro) | Since 1996, not in 8859-1 |
Hallå (Swedish hello) | Mostly ASCII |
Здравствуйте (Russian hello) | Looks a bit like ASCII |
こんにちは (Japanese hello) | No ASCII whatsoever |
≠ (different) ⇔ (iff) ∑ (sum) | Math symbols |
\ (backslash) " (double) ' (single) | Java/SQL/... special chars |
& (ampersand) < (lower than) | XML special chars |
` (slant) # (number sign) $ (dollar) | Shell special chars |
Expression | Actual result |
---|---|
From 2017-03-12 00:00 to 2017-03-13 00:00 |
23 hours in America/New_York |
From 2017-03-26 00:00 to 2017-03-27 00:00 |
23 hours in Europe/Paris |
From 2017-10-29 00:00 to 2017-10-30 00:00 |
25 hours in Europe/Paris |
From 2017-11-05 00:00 to 2017-11-06 00:00 |
25 hours in America/New_York |