2019-08-27 21:11:49 +00:00
|
|
|
'use strict'
|
2014-09-07 19:42:31 +00:00
|
|
|
|
2019-08-27 21:11:49 +00:00
|
|
|
const { test } = require('tap')
|
2023-02-21 18:28:58 +00:00
|
|
|
const { Parser } = require('../../lib')
|
2014-09-07 19:42:31 +00:00
|
|
|
|
|
|
|
test('wrong protocol error', function (t) {
|
2019-08-27 21:11:49 +00:00
|
|
|
const p = new Parser()
|
2014-09-07 19:42:31 +00:00
|
|
|
|
|
|
|
p.once('error', function (err) {
|
2019-08-27 21:11:49 +00:00
|
|
|
t.ok(err)
|
|
|
|
t.end()
|
|
|
|
})
|
2014-09-07 19:42:31 +00:00
|
|
|
|
|
|
|
// Send some bogus data to incur an error
|
2019-08-27 21:11:49 +00:00
|
|
|
p.write(Buffer.from([16, 1, 4]))
|
|
|
|
})
|