summaryrefslogtreecommitdiffstatshomepage
path: root/tests/phpunit/data/formatting/windows1252.py
diff options
context:
space:
mode:
authorAndrew Nacin <nacin@git.wordpress.org>2013-08-29 18:39:34 +0000
committerAndrew Nacin <nacin@git.wordpress.org>2013-08-29 18:39:34 +0000
commit8045afd81b7c80f6ef5b327c115a5bbb43e4b65c (patch)
tree15d457007610c451577debda89bd9e9cd3d74551 /tests/phpunit/data/formatting/windows1252.py
parentd34baebc1d8111c9c1014e11001957face778e52 (diff)
downloadwordpress-8045afd81b7c80f6ef5b327c115a5bbb43e4b65c.tar.gz
wordpress-8045afd81b7c80f6ef5b327c115a5bbb43e4b65c.zip
Move PHPUnit tests into a tests/phpunit directory.
wp-tests-config.php can/should reside in the root of a develop checkout. `phpunit` should be run from the root. see #25088. git-svn-id: https://develop.svn.wordpress.org/trunk@25165 602fd350-edb4-49c9-b593-d223f7449a82
Diffstat (limited to 'tests/phpunit/data/formatting/windows1252.py')
-rw-r--r--tests/phpunit/data/formatting/windows1252.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/phpunit/data/formatting/windows1252.py b/tests/phpunit/data/formatting/windows1252.py
new file mode 100644
index 0000000000..a4fe402703
--- /dev/null
+++ b/tests/phpunit/data/formatting/windows1252.py
@@ -0,0 +1,27 @@
+# Generates test data for functions converting between
+# dodgy windows-1252-only values and their unicode counterparts
+
+unichars = ["201A", "0192", "201E", "2026", "2020", "2021",
+ "02C6", "2030", "0160", "2039", "0152", "2018",
+ "2019", "201C", "201D", "2022", "2013", "2014",
+ "02DC", "2122", "0161", "203A", "0153", "0178"];
+
+winpoints = []
+unipoints = []
+
+for char in unichars:
+ char = unichr(int(char, 16))
+ dec = ord(char)
+ win = ord(char.encode("windows-1252"))
+
+ unipoints.append(dec)
+ winpoints.append(win)
+
+def entitize(s):
+ return "&#%s;" % s
+
+winpoints = map(entitize, winpoints)
+unipoints = map(entitize, unipoints)
+
+print "".join(winpoints), "".join(unipoints)
+