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.

AttachmentSizeStatusTest resultOperations
unicode-inc-test.patch4.55 KBIdleFailed on MySQL 5.0 ISAM, with: 152 pass(es), 6 fail(s), and 0 exception(es).View details | Re-test

#1

lilou - December 30, 2008 - 11:31
Component:base system» tests
Status:active» needs review

See also #276453: Tests needed: unicode.inc.

#2

Damien Tournoud - December 30, 2008 - 14:46

Merged #276453: Tests needed: unicode.inc tests into this one.

The tests revealed three issues in drupal_strpos(), two of them were already documented:

AttachmentSizeStatusTest resultOperations
unicode-inc-test.patch10.08 KBIdleUnable to apply patch unicode-inc-test_0.patchView details | Re-test

#3

grendzy - December 30, 2008 - 19:07

#4

Dries - December 30, 2008 - 20:19

This looks like a good patch. I was going to commit it, but then decided to wait for a reply to #3.

#5

Damien Tournoud - December 30, 2008 - 22:30

@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

Damien Tournoud - December 31, 2008 - 00:45

#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

grendzy - December 31, 2008 - 01:46
Status:needs review» reviewed & tested by the community

I tested #2, and it looks to be working well. Thanks!

#8

Dries - December 31, 2008 - 11:03
Version:7.x-dev» 6.x-dev

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

Damien Tournoud - January 1, 2009 - 19:44
Status:reviewed & tested by the community» patch (to be ported)

#10

Dave Reid - January 2, 2009 - 17:40
Version:6.x-dev» 7.x-dev
Status:patch (to be ported)» needs review

Quick code style followup for 7.x, then we can mark to for 6.x.

AttachmentSizeStatusTest resultOperations
352359-followup-D7.patch2.7 KBIdleUnable to apply patch 352359-followup-D7.patchView details | Re-test

#11

Damien Tournoud - January 2, 2009 - 17:44
Version:7.x-dev» 6.x-dev
Status:needs review» patch (to be ported)

Quick code style followup for 7.x, then we can mark to for 6.x.

No, please don't. This non-standard indenting is the only way to make sense out of the test case when reading it.

#12

Dave Reid - January 2, 2009 - 17:49

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

Damien Tournoud - January 2, 2009 - 18:30

@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

grendzy - January 7, 2009 - 20:46

BTW modules/simpletest/tests/unicode.test will work unmodified with D6 SimpleTest 2.5. The drupal_substr() bug still exists in D6, though.

 
 

Drupal is a registered trademark of Dries Buytaert.