|
f741baa…
|
drh
|
1 |
# |
|
f741baa…
|
drh
|
2 |
# Copyright (c) 2020 D. Richard Hipp |
|
f741baa…
|
drh
|
3 |
# |
|
f741baa…
|
drh
|
4 |
# This program is free software; you can redistribute it and/or |
|
f741baa…
|
drh
|
5 |
# modify it under the terms of the Simplified BSD License (also |
|
f741baa…
|
drh
|
6 |
# known as the "2-Clause License" or "FreeBSD License".) |
|
f741baa…
|
drh
|
7 |
# |
|
f741baa…
|
drh
|
8 |
# This program is distributed in the hope that it will be useful, |
|
f741baa…
|
drh
|
9 |
# but without any warranty; without even the implied warranty of |
|
f741baa…
|
drh
|
10 |
# merchantability or fitness for a particular purpose. |
|
f741baa…
|
drh
|
11 |
# |
|
f741baa…
|
drh
|
12 |
# Author contact information: |
|
f741baa…
|
drh
|
13 |
# [email protected] |
|
f741baa…
|
drh
|
14 |
# http://www.hwaci.com/drh/ |
|
f741baa…
|
drh
|
15 |
# |
|
f741baa…
|
drh
|
16 |
############################################################################ |
|
f741baa…
|
drh
|
17 |
# |
|
f741baa…
|
drh
|
18 |
# Tests for reserved names. |
|
f741baa…
|
drh
|
19 |
# |
|
f741baa…
|
drh
|
20 |
|
|
f741baa…
|
drh
|
21 |
test_setup |
|
f741baa…
|
drh
|
22 |
|
|
f741baa…
|
drh
|
23 |
############################################################################### |
|
f741baa…
|
drh
|
24 |
|
|
f741baa…
|
drh
|
25 |
set reserved_names_tests [list \ |
|
f741baa…
|
drh
|
26 |
{0 {}} \ |
|
f741baa…
|
drh
|
27 |
{0 a.fslckout} \ |
|
f741baa…
|
drh
|
28 |
{1 .fslckout} \ |
|
f741baa…
|
drh
|
29 |
{1 .FSlckOUT} \ |
|
f741baa…
|
drh
|
30 |
{2 a/.fslckout} \ |
|
f741baa…
|
drh
|
31 |
{0 .fslckout/b} \ |
|
f741baa…
|
drh
|
32 |
{0 fslckout} \ |
|
f741baa…
|
drh
|
33 |
{0 .fslckoutx} \ |
|
f741baa…
|
drh
|
34 |
{1 _FOSSIL_} \ |
|
f741baa…
|
drh
|
35 |
{0 _FOSSIL} \ |
|
f741baa…
|
drh
|
36 |
{0 FOSSIL_} \ |
|
f741baa…
|
drh
|
37 |
{0 FOSSIL_} \ |
|
f741baa…
|
drh
|
38 |
{0 a_FOSSIL_} \ |
|
f741baa…
|
drh
|
39 |
{0 _FOSSIL__} \ |
|
f741baa…
|
drh
|
40 |
{0 __FOSSIL__} \ |
|
f741baa…
|
drh
|
41 |
{0 __FOssIL__} \ |
|
f741baa…
|
drh
|
42 |
{0 _FOSSIL_/a} \ |
|
f741baa…
|
drh
|
43 |
{2 a/_FOSSIL_} \ |
|
f741baa…
|
drh
|
44 |
{2 _FOSSIL_/c/.fslckout} \ |
|
f741baa…
|
drh
|
45 |
{2 _FOSSIL_/c/.fslckout/_FOSSIL_} \ |
|
f741baa…
|
drh
|
46 |
{0 _FOSSIL_/c/.fslckout/._FOSSIL_t} \ |
|
f741baa…
|
drh
|
47 |
{0 _FOSSIL_/c/.fslckout/t._FOSSIL_} \ |
|
f741baa…
|
drh
|
48 |
{0 a} \ |
|
f741baa…
|
drh
|
49 |
{0 a/b} \ |
|
f741baa…
|
drh
|
50 |
{0 a/b/c} \ |
|
f741baa…
|
drh
|
51 |
{0 a/b/c/} \ |
|
f741baa…
|
drh
|
52 |
{0 a/_FOSSIL/} \ |
|
f741baa…
|
drh
|
53 |
{0 a/fslckout/} \ |
|
f741baa…
|
drh
|
54 |
{0 a/_fslckout/} \ |
|
f741baa…
|
drh
|
55 |
{0 _FOSSIL-wal} \ |
|
f741baa…
|
drh
|
56 |
{0 _FOSSIL-shm} \ |
|
f741baa…
|
drh
|
57 |
{0 _FOSSIL-journal} \ |
|
f741baa…
|
drh
|
58 |
{0 _FOSSIL_-wal/a} \ |
|
f741baa…
|
drh
|
59 |
{0 _FOSSIL_-shm/a} \ |
|
f741baa…
|
drh
|
60 |
{0 _FOSSIL_-journal/a} \ |
|
f741baa…
|
drh
|
61 |
{1 _FOSSIL_-wal} \ |
|
f741baa…
|
drh
|
62 |
{1 _FOSSIL_-shm} \ |
|
f741baa…
|
drh
|
63 |
{1 _FOSSIL_-journal} \ |
|
f741baa…
|
drh
|
64 |
{2 a/_FOSSIL_-wal} \ |
|
f741baa…
|
drh
|
65 |
{2 a/_FOSSIL_-shm} \ |
|
f741baa…
|
drh
|
66 |
{2 a/_FOSSIL_-journal} \ |
|
f741baa…
|
drh
|
67 |
{0 .fslckout-wal/a} \ |
|
f741baa…
|
drh
|
68 |
{0 .fslckout-shm/a} \ |
|
f741baa…
|
drh
|
69 |
{0 .fslckout-journal/a} \ |
|
f741baa…
|
drh
|
70 |
{1 .fslckout-wal} \ |
|
f741baa…
|
drh
|
71 |
{1 .fslckout-shm} \ |
|
f741baa…
|
drh
|
72 |
{1 .fslckout-journal} \ |
|
f741baa…
|
drh
|
73 |
{2 a/.fslckout-wal} \ |
|
f741baa…
|
drh
|
74 |
{2 a/.fslckout-shm} \ |
|
f741baa…
|
drh
|
75 |
{2 a/.fslckout-journal} \ |
|
f741baa…
|
drh
|
76 |
] |
|
f741baa…
|
drh
|
77 |
|
|
f741baa…
|
drh
|
78 |
############################################################################### |
|
f741baa…
|
drh
|
79 |
|
|
f741baa…
|
drh
|
80 |
set testNo 0 |
|
f741baa…
|
drh
|
81 |
|
|
f741baa…
|
drh
|
82 |
foreach reserved_names_test $reserved_names_tests { |
|
f741baa…
|
drh
|
83 |
incr testNo |
|
f741baa…
|
drh
|
84 |
|
|
f741baa…
|
drh
|
85 |
set reserved_result [lindex $reserved_names_test 0] |
|
f741baa…
|
drh
|
86 |
set reserved_name [lindex $reserved_names_test 1] |
|
f741baa…
|
drh
|
87 |
|
|
f741baa…
|
drh
|
88 |
fossil test-is-reserved-name $reserved_name |
|
f741baa…
|
drh
|
89 |
|
|
f741baa…
|
drh
|
90 |
test reserved-result-$testNo { |
|
f741baa…
|
drh
|
91 |
[lindex [normalize_result] 0] eq $reserved_result |
|
f741baa…
|
drh
|
92 |
} |
|
f741baa…
|
drh
|
93 |
|
|
f741baa…
|
drh
|
94 |
test reserved-name-$testNo { |
|
f741baa…
|
drh
|
95 |
[lindex [normalize_result] 1] eq $reserved_name |
|
f741baa…
|
drh
|
96 |
} |
|
f741baa…
|
drh
|
97 |
|
|
f741baa…
|
drh
|
98 |
fossil test-is-reserved-name [string toupper $reserved_name] |
|
f741baa…
|
drh
|
99 |
|
|
f741baa…
|
drh
|
100 |
test reserved-result-upper-$testNo { |
|
f741baa…
|
drh
|
101 |
[lindex [normalize_result] 0] eq $reserved_result |
|
f741baa…
|
drh
|
102 |
} |
|
f741baa…
|
drh
|
103 |
|
|
f741baa…
|
drh
|
104 |
test reserved-name-upper-$testNo { |
|
f741baa…
|
drh
|
105 |
[lindex [normalize_result] 1] eq [string toupper $reserved_name] |
|
f741baa…
|
drh
|
106 |
} |
|
f741baa…
|
drh
|
107 |
|
|
f741baa…
|
drh
|
108 |
fossil test-is-reserved-name [string tolower $reserved_name] |
|
f741baa…
|
drh
|
109 |
|
|
f741baa…
|
drh
|
110 |
test reserved-result-lower-$testNo { |
|
f741baa…
|
drh
|
111 |
[lindex [normalize_result] 0] eq $reserved_result |
|
f741baa…
|
drh
|
112 |
} |
|
f741baa…
|
drh
|
113 |
|
|
f741baa…
|
drh
|
114 |
test reserved-name-lower-$testNo { |
|
f741baa…
|
drh
|
115 |
[lindex [normalize_result] 1] eq [string tolower $reserved_name] |
|
f741baa…
|
drh
|
116 |
} |
|
f741baa…
|
drh
|
117 |
} |
|
f741baa…
|
drh
|
118 |
|
|
f741baa…
|
drh
|
119 |
############################################################################### |
|
f741baa…
|
drh
|
120 |
|
|
f741baa…
|
drh
|
121 |
test_cleanup |