diff --git a/lib/bcdice/game_system/Cthulhu7th_ChineseTraditional.rb b/lib/bcdice/game_system/Cthulhu7th_ChineseTraditional.rb index 31297826e..d020cd9ef 100644 --- a/lib/bcdice/game_system/Cthulhu7th_ChineseTraditional.rb +++ b/lib/bcdice/game_system/Cthulhu7th_ChineseTraditional.rb @@ -10,7 +10,7 @@ class Cthulhu7th_ChineseTraditional < Base NAME = '克蘇魯神話第7版' # ゲームシステム名の読みがな - SORT_KEY = '国際化:Chinese Traditional:克蘇魯神話' + SORT_KEY = '国際化:Chinese Traditional:克蘇魯神話第7版' # ダイスボットの使い方 HELP_MESSAGE = <<~INFO_MESSAGE_TEXT diff --git a/lib/bcdice/game_system/Cthulhu7th_Korean.rb b/lib/bcdice/game_system/Cthulhu7th_Korean.rb index 38680432c..c67bfa4a2 100644 --- a/lib/bcdice/game_system/Cthulhu7th_Korean.rb +++ b/lib/bcdice/game_system/Cthulhu7th_Korean.rb @@ -10,7 +10,7 @@ class Cthulhu7th_Korean < Base NAME = '크툴루의 부름 7판' # ゲームシステム名の読みがな - SORT_KEY = '国際化:Korean:크툴루' + SORT_KEY = '国際化:Korean:크툴루의 부름 7판' # ダイスボットの使い方 HELP_MESSAGE = <<~INFO_MESSAGE_TEXT diff --git a/lib/bcdice/game_system/Cthulhu_ChineseTraditional.rb b/lib/bcdice/game_system/Cthulhu_ChineseTraditional.rb index ff074a8b3..d19bd7f94 100644 --- a/lib/bcdice/game_system/Cthulhu_ChineseTraditional.rb +++ b/lib/bcdice/game_system/Cthulhu_ChineseTraditional.rb @@ -12,7 +12,7 @@ class Cthulhu_ChineseTraditional < Cthulhu NAME = '克蘇魯神話' # ゲームシステム名の読みがな - SORT_KEY = '国際化:Chinese Traditional:克蘇魯神話7' + SORT_KEY = '国際化:Chinese Traditional:克蘇魯神話' # ダイスボットの使い方 HELP_MESSAGE = <<~INFO_MESSAGE_TEXT diff --git a/lib/bcdice/game_system/Cthulhu_Korean.rb b/lib/bcdice/game_system/Cthulhu_Korean.rb index c984726a4..2f5a71eee 100644 --- a/lib/bcdice/game_system/Cthulhu_Korean.rb +++ b/lib/bcdice/game_system/Cthulhu_Korean.rb @@ -12,7 +12,7 @@ class Cthulhu_Korean < Cthulhu NAME = '크툴루' # ゲームシステム名の読みがな - SORT_KEY = '国際化:Korean:크툴루의부름7' + SORT_KEY = '国際化:Korean:크툴루' # ダイスボットの使い方 HELP_MESSAGE = <<~INFO_MESSAGE_TEXT diff --git a/lib/bcdice/game_system/MeikyuKingdomBasic.rb b/lib/bcdice/game_system/MeikyuKingdomBasic.rb index 72a74567d..a54c3a3e4 100644 --- a/lib/bcdice/game_system/MeikyuKingdomBasic.rb +++ b/lib/bcdice/game_system/MeikyuKingdomBasic.rb @@ -13,7 +13,7 @@ class MeikyuKingdomBasic < MeikyuKingdom NAME = '迷宮キングダム 基本ルールブック' # ゲームシステム名の読みがな - SORT_KEY = 'めいきゆうきんくたむ きほんるうるふつく' + SORT_KEY = 'めいきゆうきんくたむきほんるうるふつく' # ダイスボットの使い方 HELP_MESSAGE = <<~INFO_MESSAGE_TEXT diff --git a/test/test_sort_key.rb b/test/test_sort_key.rb new file mode 100644 index 000000000..e91da2d8b --- /dev/null +++ b/test/test_sort_key.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +require "test/unit" +require "bcdice" +require "bcdice/game_system" + +class TestSortKey < Test::Unit::TestCase + HIRAGANA_BASIC_CHARS = "あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわをん" + + data do + BCDice.all_game_systems.map { |s| [s::ID, s::SORT_KEY] }.to_h + end + def test_sort_key(sort_key) + assert_match( + /\A(?:[#{HIRAGANA_BASIC_CHARS}][\d.A-Za-z#{HIRAGANA_BASIC_CHARS}]*|国際化:[\w ]+:.+|\*たいすほつと)\z/, + sort_key, + "SORT_KEY \"#{sort_key}\" はSORT_KEYの規約に違反しています。規約は docs/dicebot_sort_key.md を参照してください" + ) + end +end