Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(347)

Side by Side Diff: third_party/sqlite/sqlite-src-3080704/test/numcast.test

Issue 949043002: Add //third_party/sqlite to dirs_to_snapshot, remove net_sql.patch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 # 2013 March 20
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 # This file implements regression tests for SQLite library.
12 # This particular file does testing of casting strings into numeric
13 # values.
14 #
15
16 set testdir [file dirname $argv0]
17 source $testdir/tester.tcl
18
19 foreach enc {utf8 utf16le utf16be} {
20 do_test numcast-$enc.0 {
21 db close
22 sqlite3 db :memory:
23 db eval "PRAGMA encoding='$enc'"
24 set x [db eval {PRAGMA encoding}]
25 string map {- {}} [string tolower $x]
26 } $enc
27 foreach {idx str rval ival} {
28 1 12345.0 12345.0 12345
29 2 12345.0e0 12345.0 12345
30 3 -12345.0e0 -12345.0 -12345
31 4 -12345.25 -12345.25 -12345
32 5 { -12345.0} -12345.0 -12345
33 6 { 876xyz} 876.0 876
34 7 { 456ķ89} 456.0 456
35 8 { Ġ 321.5} 0.0 0
36 } {
37 do_test numcast-$enc.$idx.1 {
38 db eval {SELECT CAST($str AS real)}
39 } $rval
40 do_test numcast-$enc.$idx.2 {
41 db eval {SELECT CAST($str AS integer)}
42 } $ival
43 }
44 }
45
46 finish_test
OLDNEW
« no previous file with comments | « third_party/sqlite/sqlite-src-3080704/test/null.test ('k') | third_party/sqlite/sqlite-src-3080704/test/openv2.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698