parent
							
								
									cc25852f30
								
							
						
					
					
						commit
						902e928863
					
				
					 1 changed files with 0 additions and 14 deletions
				
			
		
							
								
								
									
										14
									
								
								feed_test.go
									
										
									
									
									
								
							
							
						
						
									
										14
									
								
								feed_test.go
									
										
									
									
									
								
							| 
						 | 
					@ -7,20 +7,6 @@ import (
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var items []*Item
 | 
					var items []*Item
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func Test_NewItem(t *testing.T) {
 | 
					 | 
				
			||||||
	content, _ := ioutil.ReadFile("testdata/initial.atom")
 | 
					 | 
				
			||||||
	feed := New(1, true, chanHandler, itemHandler)
 | 
					 | 
				
			||||||
	err := feed.FetchBytes("http://example.com", content, nil)
 | 
					 | 
				
			||||||
	if err != nil { t.Error(err) }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	content, _ = ioutil.ReadFile("testdata/initial_plus_one_new.atom")
 | 
					 | 
				
			||||||
	feed.FetchBytes("http://example.com", content, nil)
 | 
					 | 
				
			||||||
	expected := "Second title"
 | 
					 | 
				
			||||||
	if expected != items[0].Title {
 | 
					 | 
				
			||||||
		t.Errorf("Expected %s, got %s", expected, items[0].Title)
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func TestFeed(t *testing.T) {
 | 
					func TestFeed(t *testing.T) {
 | 
				
			||||||
	urilist := []string{
 | 
						urilist := []string{
 | 
				
			||||||
		//"http://cyber.law.harvard.edu/rss/examples/sampleRss091.xml", // Non-utf8 encoding.
 | 
							//"http://cyber.law.harvard.edu/rss/examples/sampleRss091.xml", // Non-utf8 encoding.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue