diff options
author | Andreas Gohr <gohr@cosmocode.de> | 2012-03-13 17:32:53 +0100 |
---|---|---|
committer | Andreas Gohr <gohr@cosmocode.de> | 2012-03-13 17:32:53 +0100 |
commit | 9e760ee516dd6e50390490f6d5585b854b895808 (patch) | |
tree | b77f3edbc62d01487f0b99bc4f651a5641ba18ee | |
parent | c9f847f625f0f4094fe46392a06e4f4169f7d44c (diff) | |
download | rpg-9e760ee516dd6e50390490f6d5585b854b895808.tar.gz rpg-9e760ee516dd6e50390490f6d5585b854b895808.tar.bz2 |
added (failing) test for cleanText()
The cleanText function is supposed to convert DOS to Unix lineendings
but it seems that it doesn't always do that correctly as this thread
suggests: http://forum.dokuwiki.org/thread/8141
I added a unit test that currently fails but haven't found the real
cause yet. Further testing (and a fix) is needed.
-rw-r--r-- | _test/cases/inc/common_cleanText.test.php | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/_test/cases/inc/common_cleanText.test.php b/_test/cases/inc/common_cleanText.test.php new file mode 100644 index 000000000..571e41fa5 --- /dev/null +++ b/_test/cases/inc/common_cleanText.test.php @@ -0,0 +1,31 @@ +<?php + +require_once DOKU_INC.'inc/init.php'; +require_once DOKU_INC.'inc/common.php'; + +class common_clientIP_test extends UnitTestCase { + + function test_unix(){ + $unix = 'one + two + + three'; + + $this->assertEqual($unix,cleanText($unix)); + } + + function test_win(){ + $unix = 'one + two + + three'; + $win = 'one
+ two
+
+ three'; + $this->assertNotEqual($unix,$win); + $this->assertEqual($unix,cleanText($win)); + } +} + +//Setup VIM: ex: et ts=4 : |