xref: /sqlite-3.40.0/test/atomic.test (revision 2912da02)
1*2912da02Sdan# 2015-11-07
2*2912da02Sdan#
3*2912da02Sdan# The author disclaims copyright to this source code.  In place of
4*2912da02Sdan# a legal notice, here is a blessing:
5*2912da02Sdan#
6*2912da02Sdan#    May you do good and not evil.
7*2912da02Sdan#    May you find forgiveness for yourself and forgive others.
8*2912da02Sdan#    May you share freely, never taking more than you give.
9*2912da02Sdan#
10*2912da02Sdan#***********************************************************************
11*2912da02Sdan# This file implements regression tests for SQLite library.  The
12*2912da02Sdan# focus of this file is testing the WITH clause.
13*2912da02Sdan#
14*2912da02Sdan
15*2912da02Sdanset testdir [file dirname $argv0]
16*2912da02Sdansource $testdir/tester.tcl
17*2912da02Sdanset ::testprefix atomic
18*2912da02Sdan
19*2912da02Sdandb close
20*2912da02Sdanif {[atomic_batch_write test.db]==0} {
21*2912da02Sdan  puts "No f2fs atomic-batch-write support. Skipping tests..."
22*2912da02Sdan  finish_test
23*2912da02Sdan  return
24*2912da02Sdan}
25*2912da02Sdan
26*2912da02Sdanreset_db
27*2912da02Sdan
28*2912da02Sdando_execsql_test 1.0 {
29*2912da02Sdan  CREATE TABLE t1(x, y);
30*2912da02Sdan  BEGIN;
31*2912da02Sdan    INSERT INTO t1 VALUES(1, 2);
32*2912da02Sdan}
33*2912da02Sdan
34*2912da02Sdando_test 1.1 { file exists test.db-journal } {0}
35*2912da02Sdan
36*2912da02Sdando_execsql_test 1.2 {
37*2912da02Sdan  COMMIT;
38*2912da02Sdan}
39*2912da02Sdan
40*2912da02Sdan
41*2912da02Sdanfinish_test
42