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

Commit 1513d4b4 by Eugene Korbut

sqlite: test cases for boolean values

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