Unit test unicode.inc
Damien Tournoud - December 30, 2008 - 04:44
| Project: | Drupal |
| Version: | 6.x-dev |
| Component: | tests |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | patch (to be ported) |
Description
Here is a first test suite for unicode.inc. It demonstrates several cool breakages.
| Attachment | Size | Status | Test result | Operations |
|---|---|---|---|---|
| unicode-inc-test.patch | 4.55 KB | Idle | Failed on MySQL 5.0 ISAM, with: 152 pass(es), 6 fail(s), and 0 exception(es). | View details | Re-test |

#1
See also #276453: Tests needed: unicode.inc.
#2
Merged #276453: Tests needed: unicode.inc tests into this one.
The tests revealed three issues in drupal_strpos(), two of them were already documented:
#3
also related:
#212130: decode_entities() doesn't support all entities
#4
This looks like a good patch. I was going to commit it, but then decided to wait for a reply to #3.
#5
@Dries: #212130: decode_entities() doesn't support all entities is a valid issue. The entity decode test (mostly written by Charlie in #276453: Tests needed: unicode.inc), will be easily extended by the additional entities we should manage.
#6
#212130: decode_entities() doesn't support all entities now has a proper patch (and test extension), that depends on this one.
To clarify:
- This patch introduce a test for decode_entities (written by Charlie in #276453: Tests needed: unicode.inc). The test doesn't cover any of the missing entities so it pass correctly
- The patch in #212130: decode_entities() doesn't support all entities extends the tests of that patch and adds the missing entities (along with very significant performance and memory usage enhancements).
#7
I tested #2, and it looks to be working well. Thanks!
#8
I committed this patch to CVS HEAD. We'll want to backport part of this patch to Drupal 6 so updating the version string.
#9
#10
Quick code style followup for 7.x, then we can mark to for 6.x.
#11
No, please don't. This non-standard indenting is the only way to make sense out of the test case when reading it.
#12
Yeah, I just came back to comment that I completely missed what was going on with the indenting. It would make sense to have it that way when writing the test, but I'm not sure it's really needed though just for reading the test.
#13
@Dave: I think it makes sense to keep it that way, but I won't battle over it. Feel free to re-bump to D7 if you really don't like it.
#14
BTW modules/simpletest/tests/unicode.test will work unmodified with D6 SimpleTest 2.5. The drupal_substr() bug still exists in D6, though.