summaryrefslogtreecommitdiff
path: root/test/it_dbi.t
diff options
context:
space:
mode:
authorNathan Gass2020-09-03 11:09:33 +0200
committerNathan Gass2020-09-03 11:09:33 +0200
commite69d39a96cbf3f40745bfa2648870b5a14c0ae84 (patch)
tree69580e044ebd1fe328d4b76040ec476d56369f75 /test/it_dbi.t
parentf91966b0de61778ca27bb22893c27dc0e1a80a30 (diff)
downloaditools-e69d39a96cbf3f40745bfa2648870b5a14c0ae84.tar.gz
itools-e69d39a96cbf3f40745bfa2648870b5a14c0ae84.tar.bz2
itools-e69d39a96cbf3f40745bfa2648870b5a14c0ae84.zip
make _set tests independent of exact sql syntax
Diffstat (limited to 'test/it_dbi.t')
-rwxr-xr-xtest/it_dbi.t19
1 files changed, 6 insertions, 13 deletions
diff --git a/test/it_dbi.t b/test/it_dbi.t
index 8528a86..4341991 100755
--- a/test/it_dbi.t
+++ b/test/it_dbi.t
@@ -177,23 +177,16 @@ $record->update(['foo' => "00"]);
$rand = $record->x;
is (
$record->_set(['x' => $rand, 'foo' => "0"]),
- "SET `foo`='0'",
+ $record->_set(['foo' => "0"]),
'update: _set optimization'
);
+$record->update(['foo' => '']);
+ok(!$record->_set(['foo' => ""]), 'update: _set optimization no update "" => ""');
+ok($record->_set(['foo' => NULL]), 'update: _set optimization do update "" => NULL');
$record->update(['foo' => NULL]);
-is (
- $record->_set(['foo' => ""]),
- "SET `foo`=''",
- 'update: _set optimization with NULL => ""'
-);
-$record->update(['foo' => "bar"]);
-$record->update(['foo' => ""]);
-is (
- $record->_set(['foo' => NULL]),
- "SET `foo`=NULL",
- 'update: _set optimization with "" => NULL'
-);
+ok($record->_set(['foo' => ""]), 'update: _set optimization do update NULL => ""');
+ok(!$record->_set(['foo' => NULL]), 'update: _set optimization no update NULL => NULL');
$record->update(['foo' => "bar"]);
$record->select(['foo' => "bar"]);