defmodule Irc.Parser.IsupportTest do use ExUnit.Case alias Irc.Parser.Isupport doctest Irc.Parser.Isupport test "flag" do assert Isupport.parse(["WHOX"]) == %{"WHOX" => true} end test "k-v" do assert Isupport.parse(["HELLO=WORLD"]) == %{"HELLO" => "WORLD"} end test "k-v, integer value" do assert Isupport.parse(["RESPONSE=42"]) == %{"RESPONSE" => 42} end test "key with multiple values" do assert Isupport.parse(["TARGMAX=NAMES:1,MONITOR:,NOTICE:4"]) == %{ "TARGMAX" => %{ "NAMES" => 1, "MONITOR" => "", "NOTICE" => 4 } } end test "PREFIX" do assert Isupport.parse(["PREFIX=(ovh)@+%"]) == %{ "PREFIX" => %{ "%" => "h", "+" => "v", "@" => "o" } } end end