Fossil SCM

Use new functionality in "fossil whatis" to correct wiki test cases since /info hrefs are no longer included in the wiki pages.

andybradford 2019-07-23 04:23 test-updates
Commit ef40a0be4060ad90cbae6d0995efc673d3a7e22ad145ace046241670997cd647
1 file changed +9 -9
+9 -9
--- test/wiki.test
+++ test/wiki.test
@@ -47,23 +47,23 @@
4747
global CODE RESULT
4848
fossil http << "GET /wiki?name=$name"
4949
if {$CODE != 0} {
5050
return "error: /wiki?name=$name $CODE $RESULT"
5151
}
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]
5357
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"
5559
}
56
- fossil http << "GET /artifact/$info"
60
+ fossil artifact $info
5761
if {$CODE != 0} {
58
- return "error: /artifact/$info $CODE $RESULT"
62
+ return "error: fossil artifact $info $CODE $RESULT"
5963
}
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]
6565
if {$CODE == 0} {
6666
return "text/x-fossil-wiki"
6767
}
6868
return $mimetype
6969
}
7070
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button