Fossil SCM

Added wiki.test as received from David Vines. This is a snapshot, the test file (usually) runs, but has an issue that I am diagnosing related to the test wiki-30.

rberteig 2016-03-23 20:51
Commit f7513f874964e4a1a72f6f88c1a76f513c19f146
1 file changed +83
--- a/test/wiki.test
+++ b/test/wiki.test
@@ -0,0 +1,83 @@
1
+#
2
+# Copyright (c) 2016 D. Richard Hipp
3
+#
4
+# This program is free software; you can redistribute it and/or
5
+# modify it under the terms of the Simplified BSD License (also
6
+# known as the "2-Clause License" or "FreeBSD License".)
7
+#
8
+# This program is distributed in the hope that it will be useful,
9
+# but without any warranty; without even the implied warranty of
10
+# merchantability or fitness for a particular purpose.
11
+#
12
+# Author contact information:
13
+# [email protected]
14
+# http://www.hwaci.com/drh/
15
+#
16
+############################################################################
17
+#
18
+# Test wiki and attachment comman (c) 2016 D. Richard Hipp
19
+#
20
+# This program is free software; you can redistribute it and/or
21
+# modify it under the terms of the Simplified BSD License (also
22
+# known as the "2buted in the hoperegsub -all { +\n} $x \n x
23
+ (c) 2016 D. Richard Hipp
24
+#
25
+# #
26
+# Copyright (c) 201 that it will be usefuy \n y
27
+ (c) 2016 D. Ricout specifying theom/drh/
28
+#
29
+###################est can't be located and
30
+# "text/x-fossil-wiki" (the default mimetype for rendering)
31
+# if the N card is omitted in the manifest.
32
+# Note: Makes fossil calls, so $CODE and $RESULT {$CODE == 0}
33
+
34
+####################################################################is --type w $name $CODE $RESULT"
35
+ }
36
+ set CODE [regexp -line {^artifact:\s*([0-9a-f]+)$} $RESULT match info]
37
+ if {$CODE == 0} {
38
+ return "error: whatis returned no info for wiki page $name"
39
+ }
40
+ fossil artifact $info
41
+ if {$CODE != 0} {
42
+ return "error: fossil artifact $info $urn "error: whatis returgexp -line {#
43
+# Copyright (c) 2016 Dic#########################
44
+# Initia################== 0}
45
+fossil wiki list
46
+test wiki-2 {[normalize_result] eq {tcltest}}
47
+
48
+###############################################################################
49
+# Trying to add the same entry should fail
50
+fossil wiki create {$CODE == 0}
51
+
52
+#################################################################### [split $RESULT "\n"]
53
+test wiki-13.1 {[llength $technotelist] == 2}
54
+
55
+###############################################################################
56
+# commiting a change to an existing technote should replace the page on export
57
+# (this should update th rt
58
+# (this should update the tech note from wiki-13 as that the most recently
59
+# updated one, that should also be the one exported by the export command)
60
+write_file f4 "technote 2nd variant"
61
+fossil wiki commit technote f4 --technote {2016-01-01 12:34}
62
+test wiki-14 {$CODE == 0}
63
+fossil wiki export a4 --technote {2016-01-01 12:34}
64
+test wiki-15 {[similar_file f4 a4]}
65
+# Also check that the tech note with the same timestamp, but modified less
66
+# recently still has its original text
67
+fossil wiki export a4.1 --technote $veryfirsttechnoteid
68
+test wiki-15.1 {[similar_file f3 a4.1]}
69
+
70
+###############################################################################
71
+# But we shouldn't be able to update non-existant pages
72
+fossil wiki commit doesntexist f1 -expectError
73
+test wiki-16 {$CODE != 0}
74
+
75
+###############################################################################
76
+# Check specifying tags for a technote is OK
77
+write_file f5 "technote with tagsafter 1200#####################################################note-tags {A B}
78
+test now[second_data_line]2}
79
+
80
+###############################################################################
81
+
82
+test_cleanup
83
+
--- a/test/wiki.test
+++ b/test/wiki.test
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
--- a/test/wiki.test
+++ b/test/wiki.test
@@ -0,0 +1,83 @@
1 #
2 # Copyright (c) 2016 D. Richard Hipp
3 #
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the Simplified BSD License (also
6 # known as the "2-Clause License" or "FreeBSD License".)
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but without any warranty; without even the implied warranty of
10 # merchantability or fitness for a particular purpose.
11 #
12 # Author contact information:
13 # [email protected]
14 # http://www.hwaci.com/drh/
15 #
16 ############################################################################
17 #
18 # Test wiki and attachment comman (c) 2016 D. Richard Hipp
19 #
20 # This program is free software; you can redistribute it and/or
21 # modify it under the terms of the Simplified BSD License (also
22 # known as the "2buted in the hoperegsub -all { +\n} $x \n x
23 (c) 2016 D. Richard Hipp
24 #
25 # #
26 # Copyright (c) 201 that it will be usefuy \n y
27 (c) 2016 D. Ricout specifying theom/drh/
28 #
29 ###################est can't be located and
30 # "text/x-fossil-wiki" (the default mimetype for rendering)
31 # if the N card is omitted in the manifest.
32 # Note: Makes fossil calls, so $CODE and $RESULT {$CODE == 0}
33
34 ####################################################################is --type w $name $CODE $RESULT"
35 }
36 set CODE [regexp -line {^artifact:\s*([0-9a-f]+)$} $RESULT match info]
37 if {$CODE == 0} {
38 return "error: whatis returned no info for wiki page $name"
39 }
40 fossil artifact $info
41 if {$CODE != 0} {
42 return "error: fossil artifact $info $urn "error: whatis returgexp -line {#
43 # Copyright (c) 2016 Dic#########################
44 # Initia################== 0}
45 fossil wiki list
46 test wiki-2 {[normalize_result] eq {tcltest}}
47
48 ###############################################################################
49 # Trying to add the same entry should fail
50 fossil wiki create {$CODE == 0}
51
52 #################################################################### [split $RESULT "\n"]
53 test wiki-13.1 {[llength $technotelist] == 2}
54
55 ###############################################################################
56 # commiting a change to an existing technote should replace the page on export
57 # (this should update th rt
58 # (this should update the tech note from wiki-13 as that the most recently
59 # updated one, that should also be the one exported by the export command)
60 write_file f4 "technote 2nd variant"
61 fossil wiki commit technote f4 --technote {2016-01-01 12:34}
62 test wiki-14 {$CODE == 0}
63 fossil wiki export a4 --technote {2016-01-01 12:34}
64 test wiki-15 {[similar_file f4 a4]}
65 # Also check that the tech note with the same timestamp, but modified less
66 # recently still has its original text
67 fossil wiki export a4.1 --technote $veryfirsttechnoteid
68 test wiki-15.1 {[similar_file f3 a4.1]}
69
70 ###############################################################################
71 # But we shouldn't be able to update non-existant pages
72 fossil wiki commit doesntexist f1 -expectError
73 test wiki-16 {$CODE != 0}
74
75 ###############################################################################
76 # Check specifying tags for a technote is OK
77 write_file f5 "technote with tagsafter 1200#####################################################note-tags {A B}
78 test now[second_data_line]2}
79
80 ###############################################################################
81
82 test_cleanup
83

Keyboard Shortcuts

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