| | @@ -0,0 +1,156 @@ |
| 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 | +# The "settings" and "unset" commands that may modify the repository.
|
| 19 | +#
|
| 20 | +
|
| 21 | +le dirname [info script]]set dir [file dirname [info script]]; test_setup
|
| 22 | +
|
| 23 | +###############################################################################
|
| 24 | +##########################
|
| 25 | +
|
| 26 | +set all_settings [get_all_settings]
|
| 27 | +
|
| 28 | +foreach name $all_settings {
|
| 29 | + #
|
| 30 | + # HACK: Make 100% sure that there are no non-default setting values
|
| 31 | + # present anywhere.
|
| 32 | + #
|
| 33 | + ame --exact --global
|
| 34 | + }
|
| 35 | + --global
|
| 36 | + fossil unset $name --exact
|
| 37 | +
|
| 38 | + #
|
| 39 | + # NOTE: Query for the hard-coded default value of this setting and
|
| 40 | + # save it.
|
| 41 | + #
|
| 42 | + fossil test-th-eval "setting $name"
|
| 43 | + set defaults($name) [normalize_result]
|
| 44 | +}
|
| 45 | +
|
| 46 | +###############################################################################
|
| 47 | +
|
| 48 | +fossil setting some_value -expectError
|
| 49 | +
|
| 50 | +test settings-set-bad-local {
|
| 51 | + [normalize_result] eq "no such setting: bad-setting"
|
| 52 | +}
|
| 53 | +
|
| 54 | +fossil settings bad-ing some_value -expectError
|
| 55 | +
|
| 56 | +test settings-set-bad-global {
|
| 57 | + [normalize_result] eq "no such setting: bad-setting"
|
| 58 | +}
|
| 59 | +
|
| 60 | +###################################################tting --global -expectErrod Hipp
|
| 61 | +#
|
| 62 | +# This program is free software; you can redistribute it and/or
|
| 63 | +# modify it under the term#
|
| 64 | +# Copyright (c) 2016 D. Richard Hipp
|
| 65 | +#
|
| 66 | +# This program is free software; you can redistribute it and/or
|
| 67 | +# modify it under the terms of the Simplified BSD License (also
|
| 68 | +# known as the "2-Clause License" oing some_value -expe########################################################################
|
| 69 | +#
|
| 70 | +# Complete syntax as tested:
|
| 71 | +#
|
| 72 | +# fossil settings ?PROPERTY? ?VALUE? ?OPTIONSing some_value -expeTIONS?
|
| 73 | +#
|
| 74 | +# Where the only supported options are "--global" and "--exact".
|
| 75 | +#
|
| 76 | +###############################################################################
|
| 77 | +
|
| 78 | +set all_settings [get_all_settings]
|
| 79 | +
|
| 80 | +foreach name $all_setting --global -expect########################################################################
|
| 81 | +#
|
| 82 | +# Complete syntax as unset ssl --globaltting --global -expectTIONS?
|
| 83 | +#
|
| 84 | +# Where the only supported options are "--global" and "--exact".
|
| 85 | +#
|
| 86 | +###############################################################################
|
| 87 | +
|
| 88 | +set all_settings [get_all_settings]
|
| 89 | +
|
| 90 | +fore$name"
|
| 91 | + set defaults($name) [normalize_result]
|
| 92 | +}
|
| 93 | +
|
| 94 | +###############################################################################
|
| 95 | +
|
| 96 | +fossil settings bad-setting some_value -expectError
|
| 97 | +
|
| 98 | +test settings-set-bad-local {
|
| 99 | + [normalize_result] eq "no such setting: bad-setting"
|
| 100 | +}
|
| 101 | +
|
| 102 | +fossil settings bad-setting some_value --global -expectError
|
| 103 | +
|
| 104 | +test settings-set-bad-global {
|
| 105 | + [normalize_result] eq "no such setting: bad-setting"
|
| 106 | +}
|
| 107 | +
|
| 108 | +###############################################################################
|
| 109 | +
|
| 110 | +fossil unset bad-setting -expectError
|
| 111 | +
|
| 112 | +test settings-unset-bad-local {
|
| 113 | + [normalize_result] eq "no such setting: bad-setting"
|
| 114 | +}
|
| 115 | +
|
| 116 | +fossil unset bad-setting --global -expectError
|
| 117 | +
|
| 118 | +test settings-unset-bad-global {
|
| 119 | + [normalize_result] eq "no such setting: bad-setting"
|
| 120 | +}
|
| 121 | +
|
| 122 | +###############################################################################
|
| 123 | +
|
| 124 | +fossil settings ssl some_value -expectError
|
| 125 | +
|
| 126 | +test settings-set-ambiguous-local {
|
| 127 | + [normalize_result] eq
|
| 128 | + "ambiguous setting \"ssl\" - might be: ssl-ca-location ssl-identity"
|
| 129 | +}
|
| 130 | +
|
| 131 | +fossil settings ssl some_value --global -expectError
|
| 132 | +
|
| 133 | +test settings-set-ambiguous-global {
|
| 134 | + [normalize_result] eq
|
| 135 | + "ambiguous setting \"ssl\" - might be: ssl-ca-location ssl-identity"
|
| 136 | +}
|
| 137 | +
|
| 138 | +###############################################################################
|
| 139 | +
|
| 140 | +fossil unset ssl -expectError
|
| 141 | +
|
| 142 | +test settings-unset-ambiguous-local {
|
| 143 | + [normalize_result] eq
|
| 144 | + "ambiguous setting \"ssl\" - might be: ssl-ca-location ssl-identity"
|
| 145 | +}
|
| 146 | +
|
| 147 | +fossil unset ssl --global -expectError
|
| 148 | +
|
| 149 | +test settings-unset-ambiguous-global {
|
| 150 | + [normalize_result] eq
|
| 151 | + "ambiguous setting \"ssl\" - might be: ssl-ca-location ssl-identity"
|
| 152 | +}
|
| 153 | +
|
| 154 | +###############################################################################
|
| 155 | +
|
| 156 | +set pattern($valueversionable_for_$n |