Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F665880
commands_test.exs
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Subscribers
None
commands_test.exs
View Options
defmodule
ExIrc.CommandsTest
do
use
ExUnit.Case
,
async
:
true
use
Irc.Commands
test
"Commands are formatted properly"
do
assert
[
1
,
'TESTCMD'
,
1
]
==
ctcp!
'TESTCMD'
assert
[
1
,
'TESTCMD'
,
1
]
==
ctcp!
"TESTCMD"
assert
[[
'PASS '
,
'testpass'
],
'
\r\n
'
]
==
pass!
'testpass'
assert
[[
'PASS '
,
'testpass'
],
'
\r\n
'
]
==
pass!
"testpass"
assert
[[
'NICK '
,
'testnick'
],
'
\r\n
'
]
==
nick!
'testnick'
assert
[[
'NICK '
,
'testnick'
],
'
\r\n
'
]
==
nick!
"testnick"
assert
[[
'USER '
,
'testuser'
,
' 0 * :'
,
'Test User'
],
'
\r\n
'
]
==
user!
'testuser'
,
'Test User'
assert
[[
'USER '
,
'testuser'
,
' 0 * :'
,
'Test User'
],
'
\r\n
'
]
==
user!
"testuser"
,
'Test User'
assert
[[
'USER '
,
'testuser'
,
' 0 * :'
,
'Test User'
],
'
\r\n
'
]
==
user!
'testuser'
,
"Test User"
assert
[[
'USER '
,
'testuser'
,
' 0 * :'
,
'Test User'
],
'
\r\n
'
]
==
user!
"testuser"
,
"Test User"
assert
[[
'PONG '
,
'testnick'
],
'
\r\n
'
]
==
pong1!
'testnick'
assert
[[
'PONG '
,
'testnick'
],
'
\r\n
'
]
==
pong1!
"testnick"
assert
[[
'PONG '
,
'testnick'
,
' '
,
'othernick'
],
'
\r\n
'
]
==
pong2!
'testnick'
,
'othernick'
assert
[[
'PONG '
,
'testnick'
,
' '
,
'othernick'
],
'
\r\n
'
]
==
pong2!
"testnick"
,
'othernick'
assert
[[
'PONG '
,
'testnick'
,
' '
,
'othernick'
],
'
\r\n
'
]
==
pong2!
'testnick'
,
"othernick"
assert
[[
'PONG '
,
'testnick'
,
' '
,
'othernick'
],
'
\r\n
'
]
==
pong2!
"testnick"
,
"othernick"
assert
[[
'PRIVMSG '
,
'testnick'
,
' :'
,
'Test message!'
],
'
\r\n
'
]
==
privmsg!
'testnick'
,
'Test message!'
assert
[[
'PRIVMSG '
,
'testnick'
,
' :'
,
'Test message!'
],
'
\r\n
'
]
==
privmsg!
"testnick"
,
'Test message!'
assert
[[
'PRIVMSG '
,
'testnick'
,
' :'
,
'Test message!'
],
'
\r\n
'
]
==
privmsg!
'testnick'
,
"Test message!"
assert
[[
'PRIVMSG '
,
'testnick'
,
' :'
,
'Test message!'
],
'
\r\n
'
]
==
privmsg!
"testnick"
,
"Test message!"
assert
[[
'NOTICE '
,
'testnick'
,
' :'
,
'Test notice!'
],
'
\r\n
'
]
==
notice!
'testnick'
,
'Test notice!'
assert
[[
'NOTICE '
,
'testnick'
,
' :'
,
'Test notice!'
],
'
\r\n
'
]
==
notice!
"testnick"
,
'Test notice!'
assert
[[
'NOTICE '
,
'testnick'
,
' :'
,
'Test notice!'
],
'
\r\n
'
]
==
notice!
'testnick'
,
"Test notice!"
assert
[[
'NOTICE '
,
'testnick'
,
' :'
,
'Test notice!'
],
'
\r\n
'
]
==
notice!
"testnick"
,
"Test notice!"
assert
[[
'JOIN '
,
'testchan'
,
' '
,
''
],
'
\r\n
'
]
==
join!
'testchan'
assert
[[
'JOIN '
,
'testchan'
,
' '
,
''
],
'
\r\n
'
]
==
join!
"testchan"
assert
[[
'JOIN '
,
'testchan'
,
' '
,
'chanpass'
],
'
\r\n
'
]
==
join!
'testchan'
,
'chanpass'
assert
[[
'JOIN '
,
'testchan'
,
' '
,
'chanpass'
],
'
\r\n
'
]
==
join!
"testchan"
,
'chanpass'
assert
[[
'JOIN '
,
'testchan'
,
' '
,
'chanpass'
],
'
\r\n
'
]
==
join!
'testchan'
,
"chanpass"
assert
[[
'JOIN '
,
'testchan'
,
' '
,
'chanpass'
],
'
\r\n
'
]
==
join!
"testchan"
,
"chanpass"
assert
[[
'PART '
,
'testchan'
],
'
\r\n
'
]
==
part!
'testchan'
assert
[[
'PART '
,
'testchan'
],
'
\r\n
'
]
==
part!
"testchan"
assert
[[
'QUIT :'
,
'Leaving'
],
'
\r\n
'
]
==
quit!
assert
[[
'QUIT :'
,
'Goodbye, cruel world.'
],
'
\r\n
'
]
==
quit!
'Goodbye, cruel world.'
assert
[[
'QUIT :'
,
'Goodbye, cruel world.'
],
'
\r\n
'
]
==
quit!
"Goodbye, cruel world."
end
end
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Feb 28, 10:14 AM (1 d, 20 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
87012
Default Alt Text
commands_test.exs (3 KB)
Attached To
rEXIRC ExIRC Fork
Event Timeline
Log In to Comment