tkt-3998683a16.test 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # 2010 September 30
  2. #
  3. # The author disclaims copyright to this source code. In place of
  4. # a legal notice, here is a blessing:
  5. #
  6. # May you do good and not evil.
  7. # May you find forgiveness for yourself and forgive others.
  8. # May you share freely, never taking more than you give.
  9. #
  10. #***********************************************************************
  11. #
  12. # This file implements regression tests for SQLite library. Specifically,
  13. # it tests that ticket [3998683a16a7076e08f5585c1f4816414c8c653a] where in
  14. # floating point values with a decimal point at the beginning or end
  15. # of the mantissa are used.
  16. #
  17. set testdir [file dirname $argv0]
  18. source $testdir/tester.tcl
  19. do_test tkt-3998683a16.1 {
  20. db eval {
  21. CREATE TABLE t1(x, y REAL);
  22. INSERT INTO t1 VALUES(1, '1.0');
  23. INSERT INTO t1 VALUES(2, '.125');
  24. INSERT INTO t1 VALUES(3, '123.');
  25. INSERT INTO t1 VALUES(4, '123.e+2');
  26. INSERT INTO t1 VALUES(5, '.125e+3');
  27. INSERT INTO t1 VALUES(6, '123e4');
  28. INSERT INTO t1 VALUES(11, ' 1.0');
  29. INSERT INTO t1 VALUES(12, ' .125');
  30. INSERT INTO t1 VALUES(13, ' 123.');
  31. INSERT INTO t1 VALUES(14, ' 123.e+2');
  32. INSERT INTO t1 VALUES(15, ' .125e+3');
  33. INSERT INTO t1 VALUES(16, ' 123e4');
  34. INSERT INTO t1 VALUES(21, '1.0 ');
  35. INSERT INTO t1 VALUES(22, '.125 ');
  36. INSERT INTO t1 VALUES(23, '123. ');
  37. INSERT INTO t1 VALUES(24, '123.e+2 ');
  38. INSERT INTO t1 VALUES(25, '.125e+3 ');
  39. INSERT INTO t1 VALUES(26, '123e4 ');
  40. SELECT x FROM t1 WHERE typeof(y)=='real' ORDER BY x;
  41. }
  42. } {1 2 3 4 5 6 11 12 13 14 15 16 21 22 23 24 25 26}
  43. finish_test