Fossil SCM
Use new functionality in "fossil whatis" to correct wiki test cases since /info hrefs are no longer included in the wiki pages.
Commit
ef40a0be4060ad90cbae6d0995efc673d3a7e22ad145ace046241670997cd647
Parent
7627d4a73e2e726…
1 file changed
+9
-9
+9
-9
| --- test/wiki.test | ||
| +++ test/wiki.test | ||
| @@ -47,23 +47,23 @@ | ||
| 47 | 47 | global CODE RESULT |
| 48 | 48 | fossil http << "GET /wiki?name=$name" |
| 49 | 49 | if {$CODE != 0} { |
| 50 | 50 | return "error: /wiki?name=$name $CODE $RESULT" |
| 51 | 51 | } |
| 52 | - set CODE [regexp {href="/info/([0-9a-f]+)"} $RESULT match info] | |
| 52 | + fossil whatis --type w $name | |
| 53 | + if {$CODE != 0} { | |
| 54 | + return "error: fossil whatis --type w $name $CODE $RESULT" | |
| 55 | + } | |
| 56 | + set CODE [regexp -line {^artifact:\s*([0-9a-f]+)$} $RESULT match info] | |
| 53 | 57 | if {$CODE == 0} { |
| 54 | - return "error: No info link found for wiki page $name" | |
| 58 | + return "error: whatis returned no info for wiki page $name" | |
| 55 | 59 | } |
| 56 | - fossil http << "GET /artifact/$info" | |
| 60 | + fossil artifact $info | |
| 57 | 61 | if {$CODE != 0} { |
| 58 | - return "error: /artifact/$info $CODE $RESULT" | |
| 62 | + return "error: fossil artifact $info $CODE $RESULT" | |
| 59 | 63 | } |
| 60 | - set CODE [regexp {<pre>(.*)</pre>} $RESULT match pre] | |
| 61 | - if {$CODE == 0} { | |
| 62 | - return "error: No pre block in /artifact/$info" | |
| 63 | - } | |
| 64 | - set CODE [regexp -line {^N (.*)$} $pre match mimetype] | |
| 64 | + set CODE [regexp -line {^N (.*)$} $RESULT match mimetype] | |
| 65 | 65 | if {$CODE == 0} { |
| 66 | 66 | return "text/x-fossil-wiki" |
| 67 | 67 | } |
| 68 | 68 | return $mimetype |
| 69 | 69 | } |
| 70 | 70 |
| --- test/wiki.test | |
| +++ test/wiki.test | |
| @@ -47,23 +47,23 @@ | |
| 47 | global CODE RESULT |
| 48 | fossil http << "GET /wiki?name=$name" |
| 49 | if {$CODE != 0} { |
| 50 | return "error: /wiki?name=$name $CODE $RESULT" |
| 51 | } |
| 52 | set CODE [regexp {href="/info/([0-9a-f]+)"} $RESULT match info] |
| 53 | if {$CODE == 0} { |
| 54 | return "error: No info link found for wiki page $name" |
| 55 | } |
| 56 | fossil http << "GET /artifact/$info" |
| 57 | if {$CODE != 0} { |
| 58 | return "error: /artifact/$info $CODE $RESULT" |
| 59 | } |
| 60 | set CODE [regexp {<pre>(.*)</pre>} $RESULT match pre] |
| 61 | if {$CODE == 0} { |
| 62 | return "error: No pre block in /artifact/$info" |
| 63 | } |
| 64 | set CODE [regexp -line {^N (.*)$} $pre match mimetype] |
| 65 | if {$CODE == 0} { |
| 66 | return "text/x-fossil-wiki" |
| 67 | } |
| 68 | return $mimetype |
| 69 | } |
| 70 |
| --- test/wiki.test | |
| +++ test/wiki.test | |
| @@ -47,23 +47,23 @@ | |
| 47 | global CODE RESULT |
| 48 | fossil http << "GET /wiki?name=$name" |
| 49 | if {$CODE != 0} { |
| 50 | return "error: /wiki?name=$name $CODE $RESULT" |
| 51 | } |
| 52 | fossil whatis --type w $name |
| 53 | if {$CODE != 0} { |
| 54 | return "error: fossil whatis --type w $name $CODE $RESULT" |
| 55 | } |
| 56 | set CODE [regexp -line {^artifact:\s*([0-9a-f]+)$} $RESULT match info] |
| 57 | if {$CODE == 0} { |
| 58 | return "error: whatis returned no info for wiki page $name" |
| 59 | } |
| 60 | fossil artifact $info |
| 61 | if {$CODE != 0} { |
| 62 | return "error: fossil artifact $info $CODE $RESULT" |
| 63 | } |
| 64 | set CODE [regexp -line {^N (.*)$} $RESULT match mimetype] |
| 65 | if {$CODE == 0} { |
| 66 | return "text/x-fossil-wiki" |
| 67 | } |
| 68 | return $mimetype |
| 69 | } |
| 70 |