From: Joe Wreschnig Date: Sun, 21 Feb 2010 02:00:33 +0000 (-0800) Subject: Test cases. X-Git-Url: https://git.korewanetadesu.com/?a=commitdiff_plain;h=33c37b23aee701dcf91616e7407820dea14a8077;p=python-collate.git Test cases. --- diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/en/accents.list.txt b/tests/en/accents.list.txt new file mode 100644 index 0000000..0fc38f8 --- /dev/null +++ b/tests/en/accents.list.txt @@ -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 index 0000000..253066f --- /dev/null +++ b/tests/en/dearboy.list.txt @@ -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 index 0000000..9cb4479 --- /dev/null +++ b/tests/en/flyme.list.txt @@ -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 +Fly Me to the Moon (Aki Jungle version) +Fly Me to the Moon (Asuka Bossa Techno TV size Version) +FLY ME TO THE MOON +Fly Me to the Moon (Aya Bossa Techno version) +FLY ME TO THE MOON +FLY ME TO THE MOON +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 +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 +FLY ME TO THE MOON +FLY ME TO THE MOON +FLY ME TO THE MOON (Touched by the Muse Mix) +Fly Me to the Moon (TV. Size version) +FLY ME TO THE MOON +FLY ME TO THE MOON (YOKO TAKAHASHI Acid Bossa Version) +FLY ME TO THE MOON diff --git a/tests/en/katakanahiraganamerge.list.txt b/tests/en/katakanahiraganamerge.list.txt new file mode 100644 index 0000000..a6bd778 --- /dev/null +++ b/tests/en/katakanahiraganamerge.list.txt @@ -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 index 0000000..7a4d5ba --- /dev/null +++ b/tests/en/multiparens.list.txt @@ -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 index 0000000..eccd39a --- /dev/null +++ b/tests/en/numbers.list.txt @@ -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 index 0000000..ac2f633 --- /dev/null +++ b/tests/en/onegrouptwogroup.list.txt @@ -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 index 0000000..279aaa7 --- /dev/null +++ b/tests/en/revolution.list.txt @@ -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 index 0000000..1108215 --- /dev/null +++ b/tests/en/thanatos.list.txt @@ -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 index 0000000..49bd31f --- /dev/null +++ b/tests/en/trackn.list.txt @@ -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 index 0000000..b5fd71a --- /dev/null +++ b/tests/en/weirdstart.list.txt @@ -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 index 0000000..fbe253b --- /dev/null +++ b/tests/run.py @@ -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 index 0000000..91e28ce --- /dev/null +++ b/tests/sv/accents.list.txt @@ -0,0 +1,33 @@ +123 +a +b +c +ç +n +o +p +r +s +ss +ß +t +u +ũ +v +vw +w +wv +z +å +ååå +åäö +åöä +ä +Æther +äää +äöå +ö +ø +öäå +ööö +µ