Fossil SCM
Handle missing 'json' Tcl package gracefully.
Commit
e3297200e569702739c2b93c72eeb2793c3ad61440b4e428b609ba63bec32ed0
Parent
a34c7b37f274b65…
1 file changed
+4
-1
+4
-1
| --- test/json.test | ||
| +++ test/json.test | ||
| @@ -33,11 +33,14 @@ | ||
| 33 | 33 | # We need a JSON parser to effectively test the JSON produced by |
| 34 | 34 | # fossil. It looks like the one from tcllib is exactly what we need. |
| 35 | 35 | # On ActiveTcl, add it with teacup. On other platforms, YMMV. |
| 36 | 36 | # teacup install json |
| 37 | 37 | # teacup install json::write |
| 38 | -package require json | |
| 38 | +if {[catch {package require json}] != 0} then { | |
| 39 | + puts "The \"json\" package is not available." | |
| 40 | + test_cleanup_then_return | |
| 41 | +} | |
| 39 | 42 | |
| 40 | 43 | proc json2dict {txt} { |
| 41 | 44 | set rc [catch {::json::json2dict $txt} result options] |
| 42 | 45 | if {$rc != 0} { |
| 43 | 46 | protOut "JSON ERROR: $result" |
| 44 | 47 |
| --- test/json.test | |
| +++ test/json.test | |
| @@ -33,11 +33,14 @@ | |
| 33 | # We need a JSON parser to effectively test the JSON produced by |
| 34 | # fossil. It looks like the one from tcllib is exactly what we need. |
| 35 | # On ActiveTcl, add it with teacup. On other platforms, YMMV. |
| 36 | # teacup install json |
| 37 | # teacup install json::write |
| 38 | package require json |
| 39 | |
| 40 | proc json2dict {txt} { |
| 41 | set rc [catch {::json::json2dict $txt} result options] |
| 42 | if {$rc != 0} { |
| 43 | protOut "JSON ERROR: $result" |
| 44 |
| --- test/json.test | |
| +++ test/json.test | |
| @@ -33,11 +33,14 @@ | |
| 33 | # We need a JSON parser to effectively test the JSON produced by |
| 34 | # fossil. It looks like the one from tcllib is exactly what we need. |
| 35 | # On ActiveTcl, add it with teacup. On other platforms, YMMV. |
| 36 | # teacup install json |
| 37 | # teacup install json::write |
| 38 | if {[catch {package require json}] != 0} then { |
| 39 | puts "The \"json\" package is not available." |
| 40 | test_cleanup_then_return |
| 41 | } |
| 42 | |
| 43 | proc json2dict {txt} { |
| 44 | set rc [catch {::json::json2dict $txt} result options] |
| 45 | if {$rc != 0} { |
| 46 | protOut "JSON ERROR: $result" |
| 47 |