Test cases.
authorJoe Wreschnig <joe.wreschnig@gmail.com>
Sun, 21 Feb 2010 02:00:33 +0000 (18:00 -0800)
committerJoe Wreschnig <joe.wreschnig@gmail.com>
Sun, 21 Feb 2010 02:00:33 +0000 (18:00 -0800)
14 files changed:
tests/__init__.py [new file with mode: 0644]
tests/en/accents.list.txt [new file with mode: 0644]
tests/en/dearboy.list.txt [new file with mode: 0644]
tests/en/flyme.list.txt [new file with mode: 0644]
tests/en/katakanahiraganamerge.list.txt [new file with mode: 0644]
tests/en/multiparens.list.txt [new file with mode: 0644]
tests/en/numbers.list.txt [new file with mode: 0644]
tests/en/onegrouptwogroup.list.txt [new file with mode: 0644]
tests/en/revolution.list.txt [new file with mode: 0644]
tests/en/thanatos.list.txt [new file with mode: 0644]
tests/en/trackn.list.txt [new file with mode: 0644]
tests/en/weirdstart.list.txt [new file with mode: 0644]
tests/run.py [new file with mode: 0644]
tests/sv/accents.list.txt [new file with mode: 0644]

diff --git a/tests/__init__.py b/tests/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/en/accents.list.txt b/tests/en/accents.list.txt
new file mode 100644 (file)
index 0000000..0fc38f8
--- /dev/null
@@ -0,0 +1,33 @@
+123
+a
+ååå
+äää
+åäö
+Æther
+åöä
+äöå
+b
+c
+n
+o
+öäå
+ööö
+p
+r
+s
+ss
+t
+u
+v
+vw
+w
+wv
+z
diff --git a/tests/en/dearboy.list.txt b/tests/en/dearboy.list.txt
new file mode 100644 (file)
index 0000000..253066f
--- /dev/null
@@ -0,0 +1,4 @@
+浩志・うどんげ・稲葉
+浪漫 ~MY DEAR BOY~
+浪漫~MY DEAR BOY~ (LET'S HAVE A DREAM remix)
+浮気なハニーパイ
diff --git a/tests/en/flyme.list.txt b/tests/en/flyme.list.txt
new file mode 100644 (file)
index 0000000..9cb4479
--- /dev/null
@@ -0,0 +1,29 @@
+Fly Me To The Moon
+FLY ME TO THE MOON
+FLY ME TO THE MOON -4 BEAT OFF VOCAL TV. Size VERSION-
+FLY ME TO THE MOON -4 BEAT TV. Size VERSION-
+FLY ME TO THE MOON <Aki Jungle TV. Size Version>
+Fly Me to the Moon (Aki Jungle version)
+Fly Me to the Moon (Asuka Bossa Techno TV size Version)
+FLY ME TO THE MOON <Aya Bossa Techno TV. Size Version>
+Fly Me to the Moon (Aya Bossa Techno version)
+FLY ME TO THE MOON <Aya London Beat Version>
+FLY ME TO THE MOON <B-22a Type TV. Size Version>
+Fly Me to the Moon (In Other Words) (2007 mix)
+Fly Me to the Moon (In Other Words) (2007 mix) (original karaoke)
+FLY ME TO THE MOON (Instrumental)
+Fly Me to the Moon (Main Version II)
+Fly Me To The Moon (Main Version II)
+Fly Me to the Moon (Misato 4 beat TV size Version)
+FLY ME TO THE MOON <OFF VOCAL TV. Size Version>
+FLY ME TO THE MOON (On the Street)
+Fly Me to the Moon (Rei (#5) TV. Size Remix Version)
+Fly Me to the Moon (Rei (#6) TV. Size Remix Version)
+FLY ME TO THE MOON <Rei (#23) TV. Size Version>
+FLY ME TO THE MOON <Rei (#25) TV. Size Version>
+FLY ME TO THE MOON <Rei (#26) TV. Size Version>
+FLY ME TO THE MOON (Touched by the Muse Mix)
+Fly Me to the Moon (TV. Size version)
+FLY ME TO THE MOON <YOKO TAKAHASHI Acid Bossa TV. Size version>
+FLY ME TO THE MOON (YOKO TAKAHASHI Acid Bossa Version)
+FLY ME TO THE MOON <YOKO TAKAHASHI TV. Size Version>
diff --git a/tests/en/katakanahiraganamerge.list.txt b/tests/en/katakanahiraganamerge.list.txt
new file mode 100644 (file)
index 0000000..a6bd778
--- /dev/null
@@ -0,0 +1,9 @@
+ミツバチと科学者
+ミツバチと科学者(w/o maaya)
+みどりのもりにだかれて
+みにまむテンポ
+ミニモニ。テレフォン!リンリンリン
+ミニモニ。数え歌 〜お風呂ば〜じょん〜
+ミヘン街道
+ミラーボール
+みんなで5じぴったん
diff --git a/tests/en/multiparens.list.txt b/tests/en/multiparens.list.txt
new file mode 100644 (file)
index 0000000..7a4d5ba
--- /dev/null
@@ -0,0 +1,5 @@
+気がつけば あなた
+気持ちはつたわる
+気持ちはつたわる (instrumental)
+気持ちはつたわる (L12 remix) (feat. Rude Boy Face)
+水曜日のワイン
diff --git a/tests/en/numbers.list.txt b/tests/en/numbers.list.txt
new file mode 100644 (file)
index 0000000..eccd39a
--- /dev/null
@@ -0,0 +1,12 @@
+A 0.01
+A 0,1
+A 1
+A 1.10
+A 1,11
+A 1.12
+A 2
+A 3
+A 9,000
+A 10.000
+A 1,000,000.01
+A 1,000,000,01
diff --git a/tests/en/onegrouptwogroup.list.txt b/tests/en/onegrouptwogroup.list.txt
new file mode 100644 (file)
index 0000000..ac2f633
--- /dev/null
@@ -0,0 +1,4 @@
+Your Own Miracle
+Your Own Miracle (Disco House Mix) (remixed by makou)
+Your Own Miracle (DJMAX Portable 2 Original Soundtrack)
+Your Quest is Over
diff --git a/tests/en/revolution.list.txt b/tests/en/revolution.list.txt
new file mode 100644 (file)
index 0000000..279aaa7
--- /dev/null
@@ -0,0 +1,2 @@
+輪舞 -REVOLUTION
+輪舞-revolution- -Self Cover Ver.-
diff --git a/tests/en/thanatos.list.txt b/tests/en/thanatos.list.txt
new file mode 100644 (file)
index 0000000..1108215
--- /dev/null
@@ -0,0 +1,6 @@
+Thanatos
+THANATOS -If I Can't Be Yours-
+THANATOS-IF I CAN'T BE YOURS-
+Thanatos -If I Can't Be Yours- (Jazzy Side Stick mix)
+THANATOS-IF I CAN'T BE YOURS-"Nine Years After Mix"
+Thanatos Tower
diff --git a/tests/en/trackn.list.txt b/tests/en/trackn.list.txt
new file mode 100644 (file)
index 0000000..49bd31f
--- /dev/null
@@ -0,0 +1,19 @@
+Track 01
+Track 1
+Track 02
+Track 2
+Track 03
+Track 3
+Track 04
+Track 4
+Track 05
+Track 5
+Track 06
+Track 6
+Track 07
+Track 7
+Track 08
+Track 8
+Track 09
+Track 9
+Track 10
diff --git a/tests/en/weirdstart.list.txt b/tests/en/weirdstart.list.txt
new file mode 100644 (file)
index 0000000..b5fd71a
--- /dev/null
@@ -0,0 +1,4 @@
+Shine! Mr. Sunshine
+☆shining☆ (LIVE BAND style)
+☆shining☆ (unplugged version)
+Shining Of The Moon
diff --git a/tests/run.py b/tests/run.py
new file mode 100644 (file)
index 0000000..fbe253b
--- /dev/null
@@ -0,0 +1,43 @@
+import glob
+import os
+import random
+
+import collate.icu
+
+def main():
+    path = os.path.dirname(__file__)
+    for filename in glob.glob(os.path.join(path, "*", "*.list.txt")):
+        fileobj = open(os.path.join(path, filename), "rU")
+        locale = os.path.basename(os.path.dirname(filename))
+
+        original = [line.decode("utf-8").strip()
+                    for line in fileobj
+                    if line.strip()]
+        contents = list(original)
+
+        collator = collate.icu.Collator(locale, "utf-8")
+
+        ordered = sorted(contents, key=collator.sortemekey)
+        if ordered != original:
+            print "Failed to sort sorted", filename
+            print "  " + "\n  ".join([line.encode("utf-8") for line in ordered])
+            continue
+
+        contents.reverse()
+        ordered = sorted(contents, key=collator.sortemekey)
+        if ordered != original:
+            print "Failed to sort reversed", filename
+            print "  " + "\n  ".join([line.encode("utf-8") for line in ordered])
+            continue
+
+        random.shuffle(contents)
+        ordered = sorted(contents, key=collator.sortemekey)
+        if ordered != original:
+            print "Failed to sort shuffled", filename
+            print "  " + "\n  ".join([line.encode("utf-8") for line in ordered])
+            continue
+
+        print "Sorted", filename, "successfully."
+        
+if __name__ == "__main__":
+    main()
diff --git a/tests/sv/accents.list.txt b/tests/sv/accents.list.txt
new file mode 100644 (file)
index 0000000..91e28ce
--- /dev/null
@@ -0,0 +1,33 @@
+123
+a
+b
+c
+n
+o
+p
+r
+s
+ss
+t
+u
+v
+vw
+w
+wv
+z
+ååå
+åäö
+åöä
+Æther
+äää
+äöå
+öäå
+ööö