From e69d39a96cbf3f40745bfa2648870b5a14c0ae84 Mon Sep 17 00:00:00 2001 From: Nathan Gass Date: Thu, 3 Sep 2020 11:09:33 +0200 Subject: make _set tests independent of exact sql syntax --- test/it_dbi.t | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'test/it_dbi.t') 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"]); -- cgit v1.2.3