不要怂,就是干,撸起袖子干!

Commit b37e78af by Eugene Korbut

sqlite: add test cases for undefined value

1 parent f47d000c
Showing with 12 additions and 0 deletions
...@@ -16,6 +16,12 @@ describe('QueryGenerator', function() { ...@@ -16,6 +16,12 @@ describe('QueryGenerator', function() {
}, { }, {
arguments: ['myTable', { name: "'bar'" }], arguments: ['myTable', { name: "'bar'" }],
expectation: "INSERT INTO `myTable` (`name`) VALUES ('''bar''');" expectation: "INSERT INTO `myTable` (`name`) VALUES ('''bar''');"
}, {
arguments: ['myTable', { name: "bar", value: null }],
expectation: "INSERT INTO `myTable` (`name`,`value`) VALUES ('bar',NULL);"
}, {
arguments: ['myTable', { name: "bar", value: undefined }],
expectation: "INSERT INTO `myTable` (`name`,`value`) VALUES ('bar',NULL);"
} }
], ],
...@@ -26,6 +32,12 @@ describe('QueryGenerator', function() { ...@@ -26,6 +32,12 @@ describe('QueryGenerator', function() {
}, { }, {
arguments: ['myTable', { name: "'bar'" }, { id: 2 }], arguments: ['myTable', { name: "'bar'" }, { id: 2 }],
expectation: "UPDATE `myTable` SET `name`='''bar''' WHERE `id`=2" expectation: "UPDATE `myTable` SET `name`='''bar''' WHERE `id`=2"
}, {
arguments: ['myTable', { name: 'bar', value: null }, { id: 2 }],
expectation: "UPDATE `myTable` SET `name`='bar',`value`=NULL WHERE `id`=2"
}, {
arguments: ['myTable', { name: 'bar', value: undefined }, { id: 2 }],
expectation: "UPDATE `myTable` SET `name`='bar',`value`=NULL WHERE `id`=2"
} }
] ]
}; };
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!