Overview
Comment: | smat_tests: add 256 digraphs to the base-4096 dictionaries |
---|---|
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
26569a2ae15ea779a4bdad06e682bc9a |
User & Date: | nat on 2017-02-09 22:57:38 |
Other Links: | manifest | tags |
Context
2017-02-10
| ||
20:58 | smaz_tests: update base-4096 expected streams for the new dictionaries check-in: 541596303a user: nat tags: trunk | |
2017-02-09
| ||
22:57 | smat_tests: add 256 digraphs to the base-4096 dictionaries check-in: 26569a2ae1 user: nat tags: trunk | |
2017-02-08
| ||
22:23 | smaz_tests: remove unneeded exception caused by byte-4096 hash function check-in: b2360c3935 user: nat tags: trunk | |
Changes
Modified tests/natools-smaz_tests.adb from [b4a1d57d65] to [36eaf7fc1d].
︙ | |||
128 129 130 131 132 133 134 135 136 137 138 139 140 141 | 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | + + + | function Upper (N : Letter_Rank) return Character is (Character'Val (Character'Pos ('A') - 1 + N)); subtype Digit_Rank is Natural range 0 .. 9; function Image (N : Digit_Rank) return Character is (Character'Val (Character'Pos ('0') + N)); subtype Alphanum is Character with Static_Predicate => Alphanum in '0' .. '9' | 'A' .. 'Z' | 'a' .. 'z'; Current_Index : Smaz_Implementations.Base_4096.Base_4096_Digit := 0; Current_Offset : Positive := 1; use type Smaz_Implementations.Base_4096.Base_4096_Digit; procedure Push_Value (Dict : in out Natools.Smaz_4096.Dictionary; |
︙ | |||
153 154 155 156 157 158 159 | 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 | - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + | := Value; Current_Index := Current_Index + 1; Current_Offset := Current_Offset + Value'Length; end Push_Value; begin return Dict : Natools.Smaz_4096.Dictionary |
︙ | |||
226 227 228 229 230 231 232 | 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 | + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - + - + - + - + - + | begin case S'Length is when 2 => declare U : constant Character := S (S'First); V : constant Character := S (S'Last); begin if U = ' ' and then V in '0' .. '9' then return Rank (V); elsif U = ' ' and then V in 'A' .. 'Z' then return 10 + Rank (V); elsif U = ' ' and then V in 'a' .. 'z' then return 36 + Rank (V); elsif U in '0' .. '9' and then V in ' ' | ',' | '.' then return Rank (U) + (case V is when ' ' => 62, when ',' => 124, when '.' => 186, when others => raise Program_Error); elsif U in 'A' .. 'Z' and then V in ' ' | ',' | '.' then return Rank (U) + 10 + (case V is when ' ' => 62, when ',' => 124, when '.' => 186, when others => raise Program_Error); elsif U in 'a' .. 'z' and then V in ' ' | ',' | '.' then return Rank (U) + 36 + (case V is when ' ' => 62, when ',' => 124, when '.' => 186, when others => raise Program_Error); elsif U in ' ' .. ''' and then U = V then return 248 + Character'Pos (U) - Character'Pos (' '); |
︙ |