SQLite

Check-in [f9468e334d]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add more tests.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | toTypeFuncs
Files: files | file ages | folders
SHA1: f9468e334d6086b8a80c6a4204ec4e03fe59cf96
User & Date: mistachkin 2013-03-11 06:24:46.255
Context
2013-03-12
09:07
Increase strictness of the new experimental functions and add more tests. (check-in: 05c4463ec5 user: mistachkin tags: toTypeFuncs)
2013-03-11
06:24
Add more tests. (check-in: f9468e334d user: mistachkin tags: toTypeFuncs)
01:23
Add experimental tointeger() and todouble() SQL functions. (check-in: 465fd853d3 user: mistachkin tags: toTypeFuncs)
Changes
Unified Diff Ignore Whitespace Patch
Changes to test/func4.test.
310
311
312
313
314
315
316













































































317
318
  do_execsql_test func4-2.[incr i] {
    SELECT todouble(18446744073709551616);
  } {1.84467440737096e+19}
  do_execsql_test func4-2.[incr i] {
    SELECT todouble(18446744073709551616 + 1);
  } {1.84467440737096e+19}
}














































































finish_test







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>


310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
  do_execsql_test func4-2.[incr i] {
    SELECT todouble(18446744073709551616);
  } {1.84467440737096e+19}
  do_execsql_test func4-2.[incr i] {
    SELECT todouble(18446744073709551616 + 1);
  } {1.84467440737096e+19}
}

ifcapable check {
  set i 0
  do_execsql_test func4-3.[incr i] {
    CREATE TABLE t1(
      x INTEGER CHECK(tointeger(x) IS NOT NULL AND x = CAST(x AS INTEGER))
    );
  } {}
  do_test func4-3.[incr i] {
    catchsql {
      INSERT INTO t1 (x) VALUES (NULL);
    }
  } {1 {constraint failed}}
  do_test func4-3.[incr i] {
    catchsql {
      INSERT INTO t1 (x) VALUES (NULL);
    }
  } {1 {constraint failed}}
  do_test func4-3.[incr i] {
    catchsql {
      INSERT INTO t1 (x) VALUES ('');
    }
  } {1 {constraint failed}}
  do_test func4-3.[incr i] {
    catchsql {
      INSERT INTO t1 (x) VALUES ('bad');
    }
  } {1 {constraint failed}}
  do_test func4-3.[incr i] {
    catchsql {
      INSERT INTO t1 (x) VALUES ('1234bad');
    }
  } {1 {constraint failed}}
  do_test func4-3.[incr i] {
    catchsql {
      INSERT INTO t1 (x) VALUES (1234);
    }
  } {0 {}}
  do_test func4-3.[incr i] {
    catchsql {
      INSERT INTO t1 (x) VALUES (1234.56);
    }
  } {1 {constraint failed}}
  do_test func4-3.[incr i] {
    catchsql {
      INSERT INTO t1 (x) VALUES ('1234');
    }
  } {0 {}}
  do_test func4-3.[incr i] {
    catchsql {
      INSERT INTO t1 (x) VALUES ('1234.56');
    }
  } {1 {constraint failed}}
  do_test func4-3.[incr i] {
    catchsql {
      INSERT INTO t1 (x) VALUES (ZEROBLOB(4));
    }
  } {1 {constraint failed}}
  do_test func4-3.[incr i] {
    catchsql {
      INSERT INTO t1 (x) VALUES (X'');
    }
  } {1 {constraint failed}}
  do_test func4-3.[incr i] {
    catchsql {
      INSERT INTO t1 (x) VALUES (X'1234');
    }
  } {1 {constraint failed}}
  do_test func4-3.[incr i] {
    catchsql {
      INSERT INTO t1 (x) VALUES (X'12345678');
    }
  } {1 {constraint failed}}
  do_execsql_test func4-3.[incr i] {
    SELECT x FROM t1 ORDER BY x;
  } {1234 1234}
}

finish_test