func TestNilPacket(t *testing.T) {
	// Test for nil packet
	err := GetLDAPError(nil)
	if !IsErrorWithCode(err, ErrorUnexpectedResponse) {
		t.Errorf("Should have an 'ErrorUnexpectedResponse' error in nil packets, got: %v", err)
	}

	// Test for nil result
	kids := []*ber.Packet{
		{},  // Unused
		nil, // Can't be nil
	}
	pack := &ber.Packet{Children: kids}
	err = GetLDAPError(pack)

	if !IsErrorWithCode(err, ErrorUnexpectedResponse) {
		t.Errorf("Should have an 'ErrorUnexpectedResponse' error in nil packets, got: %v", err)
	}
}
// TestNilPacket tests that nil packets don't cause a panic.
TestNilPacket tests that nil packets don't cause a panic.
// TestNilPacket tests that nil packets don ' t cause a panic .
func TestNilPacket(t *testing.T) {
	err := GetLDAPError(nil)
	if !IsErrorWithCode(err, ErrorUnexpectedResponse) {
		t.Errorf("Should have an 'ErrorUnexpectedResponse' error in nil packets, got: %v", err)
	}
	kids := []*ber.Packet{
		{},  
		nil, 
	}
	pack := &ber.Packet{Children: kids}
	err = GetLDAPError(pack)
	if !IsErrorWithCode(err, ErrorUnexpectedResponse) {
		t.Errorf("Should have an 'ErrorUnexpectedResponse' error in nil packets, got: %v", err)
	}
}
func TestNilPacket ( t * testing . T ) { err := GetLDAPError ( nil ) if ! IsErrorWithCode ( err , ErrorUnexpectedResponse ) { t . Errorf ( " " , err ) } kids := [ ] * ber . Packet { { } , nil , } pack := & ber . Packet { Children : kids } err = GetLDAPError ( pack ) if ! IsErrorWithCode ( err , ErrorUnexpectedResponse ) { t . Errorf ( " " , err ) } }
TestNilPacket tests that nil packets don't cause a panic.
TestNilPacket tests that nil packets don ' t cause a panic .
// Test for nil packet // Test for nil result // Unused // Can't be nil