Skip to content

Commit

Permalink
Add test for token parsing of null datetime type.
Browse files Browse the repository at this point in the history
  • Loading branch information
pekim committed Dec 4, 2011
1 parent 15bfa5a commit 9bdbf38
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/unit/token/row-token-parser-test.coffee
Expand Up @@ -114,3 +114,23 @@ module.exports.datetime = (test) ->
test.strictEqual(token.columns[0].value.getTime(), new Date('January 3, 1900 00:00:45').getTime())

test.done()

module.exports.datetimeN = (test) ->
colMetaData = [type: dataTypeByName.DateTimeN]

buffer = new WritableBuffer(0)

buffer.writeUInt8(TYPE.ROW)
buffer.writeUInt8(0)
buffer = buffer.data
#console.log(buffer)

token = parser(buffer, 1, colMetaData)
#console.log(token)

test.strictEqual(token.length, buffer.length - 1)
test.strictEqual(token.columns.length, 1)
test.ok(!token.columns[0].value)
test.ok(token.columns[0].isNull)

test.done()

0 comments on commit 9bdbf38

Please sign in to comment.