File: RDFTests.m

package info (click to toggle)
rsskit 0.3-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 656 kB
  • ctags: 572
  • sloc: objc: 2,041; makefile: 48; sh: 4
file content (96 lines) | stat: -rw-r--r-- 1,726 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#import "RDFTests.h"
#import "GNUstep.h"

/**
 * Runs simple tests for RDF (RSS 1.0) files.
 */
@implementation RDFTests

-(void)testChannelDesc
{
  FETCH(@"rdf_channel_description");
  
  // FIXME: [feed description] is not a way to get the *description* but
  // to get the *title* of the feed!
  UKStringsEqual([feed description], @"Example description");
}

-(void)testChannelLink
{
  FETCH(@"rdf_channel_link");
  UKStringsEqual([[feed feedURL] description], @"Example feed");
}

-(void)testChannelTitle
{
  FETCH(@"rdf_channel_title");
  UKStringsEqual([feed description], @"Example feed");
}

-(void)testItemDesc
  {
    FETCH(@"rdf_item_description");
    UKTrue([feed count] > 0);
    
    RSSArticle* art = [feed articleAtIndex: 0];
    UKNotNil(art);
    
    UKStringsEqual([art description], @"Example description");
  }

-(void)testItemLink
  {
    FETCH(@"rdf_item_link");
    UKTrue([feed count] > 0);
    
    RSSArticle* art = [feed articleAtIndex: 0];
    UKNotNil(art);
    
    UKStringsEqual(@"http://example.com/1", [art url]);
  }

-(void)testItemRDFAbout
  {
    FETCH(@"rdf_item_rdf_about");
    UKTrue([feed count] > 0);
    
    RSSArticle* art = [feed articleAtIndex: 0];
    UKNotNil(art);
    
    // XXX: The semantics of rdf:about? Can we use this as URL?
    UKStringsEqual(@"http://example.org/1", [art url]);
  }

-(void)testItemTitle
  {
    FETCH(@"rdf_item_title");
    UKTrue([feed count] > 0);
    
    RSSArticle* art = [feed articleAtIndex: 0];
    UKNotNil(art);
    
    UKStringsEqual([art headline], @"Example title");
  }

/*

-(void)testRSS090ChannelTitle
  {
  }

-(void)testRSS090ItemTitle
  {
  }

-(void)testRSSV10
  {
  }

-(void)testRSSV10NotDefaultNS
  {
  }

*/

@end