github.com/fumiama/NanoBot@v0.0.0-20231122134259-c22d8183efca/helper_test.go (about) 1 package nano 2 3 import "testing" 4 5 func TestUnderlineToCamel(t *testing.T) { 6 x := UnderlineToCamel("GUILD_CREATE") 7 if x != "GuildCreate" { 8 t.Fatal("expected GuildCreate but got", x) 9 } 10 x = UnderlineToCamel("GUILD_MEMBER_UPDATE") 11 if x != "GuildMemberUpdate" { 12 t.Fatal("expected GuildMemberUpdate but got", x) 13 } 14 x = UnderlineToCamel("OPEN_FORUM_THREAD_CREATE") 15 if x != "OpenForumThreadCreate" { 16 t.Fatal("expected OpenForumThreadCreate but got", x) 17 } 18 x = UnderlineToCamel("AUDIO_OR_LIVE_CHANNEL_MEMBER_ENTER") 19 if x != "AudioOrLiveChannelMemberEnter" { 20 t.Fatal("expected AudioOrLiveChannelMemberEnter but got", x) 21 } 22 }