mirror of
				https://github.com/fluffle/goirc
				synced 2025-11-04 03:58:03 +00:00 
			
		
		
		
	Call init in connect so theres no special casing for tests.
This commit is contained in:
		
							parent
							
								
									8e16f59b5f
								
							
						
					
					
						commit
						ed85f957b5
					
				
					 2 changed files with 1 additions and 4 deletions
				
			
		| 
						 | 
					@ -171,6 +171,7 @@ func (conn *Conn) Connect(host string, pass ...string) error {
 | 
				
			||||||
		conn.password = ""
 | 
							conn.password = ""
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	conn.postConnect()
 | 
						conn.postConnect()
 | 
				
			||||||
 | 
						conn.dispatch(&Line{Cmd: INIT})
 | 
				
			||||||
	return nil
 | 
						return nil
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -188,7 +189,6 @@ func (conn *Conn) postConnect() {
 | 
				
			||||||
		go func() { <-conn.cPing }()
 | 
							go func() { <-conn.cPing }()
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	go conn.runLoop()
 | 
						go conn.runLoop()
 | 
				
			||||||
	conn.dispatch(&Line{Cmd: INIT})
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// copied from http.client for great justice
 | 
					// copied from http.client for great justice
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -33,9 +33,6 @@ func setUp(t *testing.T, start ...bool) (*Conn, *testState) {
 | 
				
			||||||
		// Hack to allow tests of send, recv, write etc.
 | 
							// Hack to allow tests of send, recv, write etc.
 | 
				
			||||||
		// NOTE: the value of the boolean doesn't matter.
 | 
							// NOTE: the value of the boolean doesn't matter.
 | 
				
			||||||
		c.postConnect()
 | 
							c.postConnect()
 | 
				
			||||||
		// All connections start with NICK/USER expect these.
 | 
					 | 
				
			||||||
		nc.Expect("NICK test")
 | 
					 | 
				
			||||||
		nc.Expect("USER test 12 * :Testing IRC")
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		// Sleep 1ms to allow background routines to start.
 | 
							// Sleep 1ms to allow background routines to start.
 | 
				
			||||||
		<-time.After(1e6)
 | 
							<-time.After(1e6)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue