fantasdic r389 - in trunk: . test
- From: mblondel svn gnome org
- To: svn-commits-list gnome org
- Subject: fantasdic r389 - in trunk: . test
- Date: Sun, 18 Jan 2009 22:48:56 +0000 (UTC)
Author: mblondel
Date: Sun Jan 18 22:48:56 2009
New Revision: 389
URL: http://svn.gnome.org/viewvc/fantasdic?rev=389&view=rev
Log:
* test/test_utils.rb: More complete test for hiragana? and katakana?.
Modified:
trunk/ChangeLog
trunk/test/test_utils.rb
Modified: trunk/test/test_utils.rb
==============================================================================
--- trunk/test/test_utils.rb (original)
+++ trunk/test/test_utils.rb Sun Jan 18 22:48:56 2009
@@ -15,6 +15,8 @@
#Âwith this program; if not, write to the Free Software Foundation, Inc.,
#Â51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+$KCODE="u"
+
$test_dir = File.expand_path(File.dirname(__FILE__))
$top_dir = File.expand_path(File.join($test_dir, ".."))
$lib_dir = File.expand_path(File.join($top_dir, "lib"))
@@ -49,12 +51,44 @@
assert_equal("ãããã".hiragana?, true)
assert_equal("ãããã".katakana?, false)
assert_equal("ãããã".kanji?, false)
+
+hiragana = <<EOL
+ããããããããããã
+ãããããããããã
+ãããããããããã
+ããããããããããã
+ããããã
+ããããããããããããããã
+ããããã
+ãããããã
+ããããã
+ãããããã
+EOL
+ hiragana.gsub!(/[\s\n]+/, "")
+ assert_equal(hiragana.hiragana?, true)
end
def test_katakana
assert_equal("ãããã".hiragana?, false)
assert_equal("ãããã".katakana?, true)
assert_equal("ãããã".kanji?, false)
+
+katakana = <<EOL
+ããããããããããã
+ãããããããããã
+ããããããããã
+ãããã
+ããããããã
+ããããã
+ããããããããããããããã
+ããããã
+ãããããã
+ããããã
+ãããã
+EOL
+
+ katakana.gsub!(/[\s\n]+/, "")
+ assert_equal(katakana.katakana?, true)
end
def test_kanji
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]