File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -181,6 +181,34 @@ func TestMotdCommand(t *testing.T) {
181181if strings .Compare (host .motd , "foobar" ) != 0 {
182182t .Error ("failed to hinder non-OPs to modify the MOTD" )
183183}
184+
185+ // Test as OP - expected behaviour: should modify the MOTD
186+ host .Room .Ops .Add (member )
187+ testMotd = "barfoo"
188+ w .Write ([]byte ("/motd barfoo\r \n " ))
189+
190+ // Fix this during the code-review process
191+ time .Sleep (time .Millisecond * 500 )
192+
193+ if strings .Compare (host .motd , testMotd ) != 0 {
194+ t .Error ("failed to allow OPs to modify the MOTD" )
195+ }
196+
197+ // Get around rate limitation
198+ time .Sleep (time .Second * 3 )
199+
200+ // Test as OP - expected behaviour: should print the MOTD even if OP
201+ w .Write ([]byte ("/motd\r \n " ))
202+
203+ nextScanToken (scanner , 8 )
204+
205+ actual = scanner .Text ()
206+ actual = stripPrompt (actual )[3 :]
207+ expected = "barfoo"
208+ if strings .Compare (actual , expected ) != 0 {
209+ t .Error ("failed to print MOTD using /motd with no parameters - as OP" )
210+ }
211+
184212return nil
185213})
186214}
You can’t perform that action at this time.
0 commit comments