@@ -4,16 +4,30 @@ import (
44 "testing"
55)
66
7- func TestPieceAttr (t * testing.T ) {
7+ func TestPiece (t * testing.T ) {
8+ testCases (t , "Piece raw html" , []testCase {
9+ {"piece_raw_a" ,
10+ []string {"-i" , "opt_piece_attr.html" , "-o" , "-c" , "ul > li" , "-p" , "Source=RAW:a" },
11+ },
12+ })
813 testCases (t , "Piece Attributes" , []testCase {
914 {"id" ,
10- []string {"-i" , "opt_piece_attr.html" , "-o" , "-c" , "li > a" , "-p" , "url =ATTR:id" },
15+ []string {"-i" , "opt_piece_attr.html" , "-o" , "-c" , "li > a" , "-p" , "id =ATTR:id" },
1116 },
1217 {"href" ,
1318 []string {"-i" , "opt_piece_attr.html" , "-o" , "-c" , "li > a" , "-p" , "url=ATTR:href" },
1419 },
15- //{"both_fields",},
16- //{"noexist"},
20+ {"both_fields" ,
21+ []string {"-i" , "opt_piece_attr.html" , "-o" , "-c" , "li > a" ,
22+ "-p" , "id=ATTR:id" , "-p" , "url=ATTR:href" },
23+ },
24+
25+ {"noexist" ,
26+ []string {"-i" , "opt_piece_attr.html" , "-o" , "-c" , "li > a" , "-p" , "NoExist=ATTR:noexist" },
27+ },
28+ {"script_src" ,
29+ []string {"-i" , "opt_piece_script.html" , "-o" , "-c" , "html > head > script" , "-p" , "SourceJS=ATTR:src" },
30+ },
1731 //{},
1832 })
1933}
0 commit comments