mirror of
				https://github.com/fluffle/goirc
				synced 2025-11-03 19:48:04 +00:00 
			
		
		
		
	Test CTCP handler.
This commit is contained in:
		
							parent
							
								
									7d9b8c3099
								
							
						
					
					
						commit
						8fc23d5c17
					
				
					 1 changed files with 22 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -119,3 +119,25 @@ func TestNICK(t *testing.T) {
 | 
			
		|||
		timer.Stop()
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func TestCTCP(t *testing.T) {
 | 
			
		||||
	m, c := setUp(t)
 | 
			
		||||
 | 
			
		||||
	// Call handler with CTCP VERSION
 | 
			
		||||
	c.h_CTCP(parseLine(":blah!moo@cows.com PRIVMSG test :\001VERSION\001"))
 | 
			
		||||
 | 
			
		||||
	// Expect a version reply
 | 
			
		||||
	m.Expect("NOTICE blah :\001VERSION powered by goirc...\001")
 | 
			
		||||
 | 
			
		||||
	// Call handler with CTCP PING
 | 
			
		||||
	c.h_CTCP(parseLine(":blah!moo@cows.com PRIVMSG test :\001PING 1234567890\001"))
 | 
			
		||||
 | 
			
		||||
	// Expect a ping reply
 | 
			
		||||
	m.Expect("NOTICE blah :\001PING 1234567890\001")
 | 
			
		||||
 | 
			
		||||
	// Call handler with CTCP UNKNOWN
 | 
			
		||||
	c.h_CTCP(parseLine(":blah!moo@cows.com PRIVMSG test :\001UNKNOWN ctcp\001"))
 | 
			
		||||
 | 
			
		||||
	// Expect nothing in reply
 | 
			
		||||
	m.ExpectNothing()
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue