Skip to content

Commit 0a32e61

Browse files
committed
Update unit testing - insert.t
1 parent a39dd1a commit 0a32e61

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

t/02-query/insert.t

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ my $sql_abstract = CellBIS::SQL::Abstract->new();
88
my $to_compare = '';
99
my $insert = '';
1010

11+
# For Prepare statement with NOW() Function
1112
$to_compare = 'INSERT INTO table_test(col1, col2, col3) VALUES(?, ?, NOW())';
1213
$insert = $sql_abstract->insert(
1314
'table_test',
@@ -16,6 +17,7 @@ $insert = $sql_abstract->insert(
1617
);
1718
is($insert, $to_compare, "SQL Query : \n$insert");
1819

20+
# non-prepare statement
1921
$to_compare
2022
= 'INSERT INTO table_test(col1, col2, col3) VALUES(\'val1\', \'val2\', \'val3\')';
2123
$insert = $sql_abstract->insert(
@@ -25,5 +27,15 @@ $insert = $sql_abstract->insert(
2527
);
2628
is($insert, $to_compare, "SQL Query : \n$insert");
2729

30+
# non-prepare statement with empty value
31+
$to_compare
32+
= 'INSERT INTO table_test(col1, col2, col3, col4) VALUES(\'val1\', \'val2\', \'val3\', \'\')';
33+
$insert = $sql_abstract->insert(
34+
'table_test',
35+
['col1', 'col2', 'col3', 'col4'],
36+
['val1', 'val2', 'val3', '']
37+
);
38+
is($insert, $to_compare, "SQL Query : \n$insert");
39+
2840
done_testing();
2941

0 commit comments

Comments
 (0)