1 Testing Empty String and empty var assigned(ie, empty)2Empty has no value assigned (ie, empty), Foo has a value, NotExist doesn't exist 3 Some of these tests are pretty silly 4 ---------------------------------------------------------------------------------- 5 6 Testing == '' 7 [1] Empty == '' 8 <?cs if:Empty == '' ?> 9 PASS 10 <?cs else ?> 11 FAIL - empty string should equal empty string [1] 12 <?cs /if ?> 13 [2] Foo == '' 14 <?cs if:Foo == '' ?> 15 FAIL - existing var shouldn't equal empty string [2] 16 <?cs else ?> 17 PASS 18 <?cs /if ?> 19 [3] NotExist == '' 20 <?cs if:NotExist == '' ?> 21 FAIL - non-existing should be NULL, not empty string [3] 22 <?cs else ?> 23 PASS 24 <?cs /if ?> 25 26 Testing != '' 27 [4] Empty != '' 28 <?cs if:Empty != '' ?> 29 FAIL - Empty var should equal empty string [4] 30 <?cs else ?> 31 PASS 32 <?cs /if ?> 33 [5] Foo != '' 34 <?cs if:Foo != '' ?> 35 PASS 36 <?cs else ?> 37 FAIL - [5] 38 <?cs /if ?> 39 [6] NotExist != '' 40 <?cs if:NotExist != '' ?> 41 PASS - Non existing var doesn't equal empty string 42 <?cs else ?> 43 FAIL - [6] 44 <?cs /if ?> 45 46 Testing ? 47 [7] ?Empty 48 <?cs if:?Empty ?> 49 PASS 50 <?cs else ?> 51 FAIL - [7] 52 <?cs /if ?> 53 [8] ?Foo 54 <?cs if:?Foo ?> 55 PASS 56 <?cs else ?> 57 FAIL - [8] 58 <?cs /if ?> 59 [9] ?NotExist 60 <?cs if:?NotExist ?> 61 FAIL - non existing var shouldn't exist [9] 62 <?cs else ?> 63 PASS 64 <?cs /if ?> 65 66 Testing ! 67 [10] !Empty 68 <?cs if:!Empty ?> 69 PASS 70 <?cs else ?> 71 FAIL - [10] 72 <?cs /if ?> 73 [11] !Foo 74 <?cs if:!Foo ?> 75 FAIL - existing string shouldn't evaluate false [11] 76 <?cs else ?> 77 PASS 78 <?cs /if ?> 79 [12] !NotExist 80 <?cs if:!NotExist ?> 81 PASS 82 <?cs else ?> 83 FAIL - [12] 84 <?cs /if ?> 85 86 Testing !? 87 [13] !?Empty 88 <?cs if:!?Empty ?> 89 FAIL - empty string shouldn't evaluate non-existing [13] 90 <?cs else ?> 91 PASS 92 <?cs /if ?> 93 [14] !?Foo 94 <?cs if:!?Foo ?> 95 FAIL - non-empty string shouldn't evaluate non-existing [14] 96 <?cs else ?> 97 PASS 98 <?cs /if ?> 99 [15] !?NotExist 100 <?cs if:!?NotExist ?> 101 PASS 102 <?cs else ?> 103 FAIL - [15] 104 <?cs /if ?> 105 106 Testing ?! - Existance only works on a var, otherwise always returns 107 true, so ?! is always true 108 [16] ?!Empty 109 <?cs if:?!Empty ?> 110 PASS 111 <?cs else ?> 112 FAIL - [16] 113 <?cs /if ?> 114 [17] ?!Foo 115 <?cs if:?!Foo ?> 116 PASS 117 <?cs else ?> 118 FAIL - [17] 119 <?cs /if ?> 120 [18] ?!NotExist 121 <?cs if:?!NotExist ?> 122 PASS 123 <?cs else ?> 124 FAIL - [18] 125 <?cs /if ?> 126 127 Testing ? and == '' - boolean vs. equality? um... boolean is a number, 128 so these are numeric evals, and empty string is 0 129 [19] ?Empty == '' 130 <?cs if:?Empty == ''?> 131 FAIL - IF boolean true equals empty [19] 132 <?cs else ?> 133 PASS - ELSE boolean true doesn't equal empty (1 != 0) 134 <?cs /if ?> 135 [20] ?Foo == '' 136 <?cs if:?Foo == ''?> 137 FAIL - IF boolean true equals empty [20] 138 <?cs else ?> 139 PASS - ELSE boolean true doesn't equal empty (1 != 0) 140 <?cs /if ?> 141 [21] ?NotExist == '' 142 <?cs if:?NotExist == '' ?> 143 PASS - IF boolean false equals empty (0 == 0) 144 <?cs else ?> 145 [22] FAIL - ELSE boolean false doesn't equal empty [22] 146 <?cs /if ?> 147 148 Testing ? and != '' - boolean vs. in-equality? um... 149 [23] ?Empty != '' 150 <?cs if:?Empty != ''?> 151 PASS - IF boolean true not equal empty (1 != 0) 152 <?cs else ?> 153 FAIL - ELSE boolean true equals empty [23] 154 <?cs /if ?> 155 [24] ?Foo != '' 156 <?cs if:?Foo != ''?> 157 PASS - IF boolean true not equal empty (1 != 0) 158 <?cs else ?> 159 FAIL - ELSE boolean true equals empty [24] 160 <?cs /if ?> 161 [25] ?NotExist != '' 162 <?cs if:?NotExist != '' ?> 163 FAIL - IF boolean false not equal empty [25] 164 <?cs else ?> 165 PASS - ELSE boolean false equals empty (0 == 0) 166 <?cs /if ?> 167 168 Testing !? and == '' - all boolean true equals empty 169 [26] !?Empty == '' 170 <?cs if:!?Empty == ''?> 171 PASS - IF boolean true equals empty 172 <?cs else ?> 173 FAIL - ELSE boolean true doesn't equal empty [26] 174 <?cs /if ?> 175 [27] !?Foo == '' 176 <?cs if:!?Foo == ''?> 177 PASS - IF boolean true equals empty 178 <?cs else ?> 179 FAIL - ELSE boolean true doesn't equal empty [27] 180 <?cs /if ?> 181 [28] !?NotExist == '' 182 <?cs if:!?NotExist == '' ?> 183 FAIL - IF boolean true equals empty [28] 184 <?cs else ?> 185 PASS - ELSE boolean true doesn't equal empty 186 <?cs /if ?> 187 188 Testing !? and != '' 189 [29] !?Empty != '' 190 <?cs if:!?Empty != '' ?> 191 FAIL - IF boolean true not equal empty [29] 192 <?cs else ?> 193 PASS - ELSE boolean true equals empty 194 <?cs /if ?> 195 [30] !?Foo != '' 196 <?cs if:!?Foo != '' ?> 197 FAIL - IF boolean true not equal empty [30] 198 <?cs else ?> 199 PASS - ELSE boolean true equals empty 200 <?cs /if ?> 201 [31] !?NotExist != '' 202 <?cs if:!?NotExist != '' ?> 203 PASS - IF boolean true not equal empty 204 <?cs else ?> 205 FAIL - ELSE boolean true equals empty [31] 206 <?cs /if ?> 207