CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
84 lines
1.9 KiB
Plaintext
84 lines
1.9 KiB
Plaintext
# 2014-06-16
|
|
#
|
|
# The author disclaims copyright to this source code. In place of
|
|
# a legal notice, here is a blessing:
|
|
#
|
|
# May you do good and not evil.
|
|
# May you find forgiveness for yourself and forgive others.
|
|
# May you share freely, never taking more than you give.
|
|
#
|
|
#***********************************************************************
|
|
#
|
|
# This file implements tests for various small extensions.
|
|
#
|
|
|
|
set testdir [file dirname $argv0]
|
|
source $testdir/tester.tcl
|
|
set ::testprefix extension01
|
|
|
|
load_static_extension db fileio
|
|
do_test 1.0 {
|
|
forcedelete file1.txt
|
|
set out [open ./file1.txt wb]
|
|
puts -nonewline $out "This is a text file without a line ending"
|
|
close $out
|
|
db eval {
|
|
CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT);
|
|
INSERT INTO t1 VALUES(1, readfile('./file1.txt'));
|
|
SELECT * FROM t1;
|
|
}
|
|
} {1 {This is a text file without a line ending}}
|
|
do_test 1.1 {
|
|
forcedelete file2.txt
|
|
db nullvalue nil
|
|
db eval {
|
|
DELETE FROM t1;
|
|
INSERT INTO t1 VALUES(2, readfile(NULL)),(3, readfile('file2.txt'));
|
|
SELECT a, b, typeof(b) FROM t1;
|
|
}
|
|
} {2 nil null 3 nil null}
|
|
|
|
do_test 1.2 {
|
|
db eval {
|
|
SELECT writefile('./file2.txt', 'A second test line');
|
|
}
|
|
} {18}
|
|
do_test 1.3 {
|
|
set in [open ./file2.txt rb]
|
|
set x [read $in]
|
|
close $in
|
|
list $x [file size file2.txt]
|
|
} {{A second test line} 18}
|
|
|
|
do_test 1.4 {
|
|
db eval {
|
|
SELECT writefile('./file2.txt', NULL);
|
|
}
|
|
} {0}
|
|
do_test 1.5 {
|
|
file size ./file2.txt
|
|
} {0}
|
|
|
|
do_test 1.6 {
|
|
if {$::tcl_platform(platform)=="unix"} {
|
|
file attributes ./file2.txt -permissions r--r--r--
|
|
} else {
|
|
file attributes ./file2.txt -readonly 1
|
|
}
|
|
db eval {
|
|
SELECT writefile('./file2.txt', 'Another test');
|
|
}
|
|
} {nil}
|
|
do_test 1.7 {
|
|
if {$::tcl_platform(platform)=="unix"} {
|
|
file attributes ./file2.txt -permissions rw-r--r--
|
|
} else {
|
|
file attributes ./file2.txt -readonly 0
|
|
}
|
|
db eval {
|
|
SELECT writefile(NULL, 'Another test');
|
|
}
|
|
} {nil}
|
|
|
|
finish_test
|