mirror of
				https://github.com/FluuxIO/go-xmpp.git
				synced 2025-11-03 16:53:44 -08:00 
			
		
		
		
	Adding basic tests
This commit is contained in:
		
							
								
								
									
										5
									
								
								.travis.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								.travis.yml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,5 @@
 | 
			
		||||
language: go
 | 
			
		||||
 | 
			
		||||
go:
 | 
			
		||||
  - 1.5
 | 
			
		||||
  - tip
 | 
			
		||||
							
								
								
									
										28
									
								
								xmpp/jid_test.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								xmpp/jid_test.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,28 @@
 | 
			
		||||
package xmpp
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"testing"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
func TestBareJid(t *testing.T) {
 | 
			
		||||
	var jid *Jid
 | 
			
		||||
	var err error
 | 
			
		||||
 | 
			
		||||
	bareJid := "test@domain.com"
 | 
			
		||||
 | 
			
		||||
	if jid, err = NewJid(bareJid); err != nil {
 | 
			
		||||
		t.Error("could not parse bare jid")
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if jid.username != "test" {
 | 
			
		||||
		t.Error("incorrect bare jid username")
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if jid.domain != "domain.com" {
 | 
			
		||||
		t.Error("incorrect bare jid domain")
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if jid.resource != "" {
 | 
			
		||||
		t.Error("bare jid resource should be empty")
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user