/ Check-in [838654e5]
Login

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

Overview
Comment:Add requirements test cases for determining when an expression is true and when it is false.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 838654e56304a5788ac384ca506c1938f48af488
User & Date: drh 2013-11-26 22:46:54
Context
2013-11-26
23:27
Make sure the update hook is not invoked for WITHOUT ROWID tables, as the documentation specifies. This bug was found while adding requirements marks, so a few extraneous requirements marks are included in this check-in. check-in: 0978bac6 user: drh tags: trunk
22:46
Add requirements test cases for determining when an expression is true and when it is false. check-in: 838654e5 user: drh tags: trunk
21:18
Changing the CAST behavior of REAL values actually changed a documented requirement. So we also have to change the requirement evidence text to match. check-in: d84aa44e user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/e_expr.test.

  1844   1844   #
  1845   1845   foreach {tn expr} {
  1846   1846       1  { ( SELECT x FROM t4 WHERE x>3 ORDER BY x )      }
  1847   1847       2  { ( SELECT x FROM t4 WHERE y<'one' ORDER BY y )  }
  1848   1848   } {
  1849   1849     do_expr_test e_expr-36.4.$tn $expr null {}
  1850   1850   }
         1851  +
         1852  +# EVIDENCE-OF: R-62477-06476 For example, the values NULL, 0.0, 0,
         1853  +# 'english' and '0' are all considered to be false.
         1854  +#
         1855  +do_execsql_test e_expr-37.1 {
         1856  +   SELECT CASE WHEN NULL THEN 'true' ELSE 'false' END;
         1857  +} {false}
         1858  +do_execsql_test e_expr-37.2 {
         1859  +   SELECT CASE WHEN 0.0 THEN 'true' ELSE 'false' END;
         1860  +} {false}
         1861  +do_execsql_test e_expr-37.3 {
         1862  +   SELECT CASE WHEN 0 THEN 'true' ELSE 'false' END;
         1863  +} {false}
         1864  +do_execsql_test e_expr-37.4 {
         1865  +   SELECT CASE WHEN 'engligh' THEN 'true' ELSE 'false' END;
         1866  +} {false}
         1867  +do_execsql_test e_expr-37.5 {
         1868  +   SELECT CASE WHEN '0' THEN 'true' ELSE 'false' END;
         1869  +} {false}
         1870  +
         1871  +# EVIDENCE-OF: R-55532-10108 Values 1, 1.0, 0.1, -0.1 and '1english' are
         1872  +# considered to be true.
         1873  +#
         1874  +do_execsql_test e_expr-37.6 {
         1875  +   SELECT CASE WHEN 1 THEN 'true' ELSE 'false' END;
         1876  +} {true}
         1877  +do_execsql_test e_expr-37.7 {
         1878  +   SELECT CASE WHEN 1.0 THEN 'true' ELSE 'false' END;
         1879  +} {true}
         1880  +do_execsql_test e_expr-37.8 {
         1881  +   SELECT CASE WHEN 0.1 THEN 'true' ELSE 'false' END;
         1882  +} {true}
         1883  +do_execsql_test e_expr-37.9 {
         1884  +   SELECT CASE WHEN -0.1 THEN 'true' ELSE 'false' END;
         1885  +} {true}
         1886  +do_execsql_test e_expr-37.10 {
         1887  +   SELECT CASE WHEN '1english' THEN 'true' ELSE 'false' END;
         1888  +} {true}
  1851   1889   
  1852   1890   
  1853   1891   finish_test