Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adding new parse tests for each message type.

  • Loading branch information...
commit 3828ff4c6d5a4f70a1204226376e790a34b2fe2f 1 parent 6851341
Squeeks authored
Showing with 20 additions and 0 deletions.
  1. +20 −0 test/parse-3164.js
20 test/parse-3164.js
View
@@ -0,0 +1,20 @@
+var syslogParser = require('../lib/glossy/parse.js'),
+ assert = require('assert'),
+ fs = require('fs');
+
+assert.ok(syslogParser, 'parser loaded');
+
+var messages = JSON.parse(fs.readFileSync(__dirname + '/fixtures/RFC3164.json', 'utf8'));
+
+
+for(message in messages) {
+ parsed = syslogParser.parse(messages[message]);
+ assert.ok(parsed);
+};
+
+// TODO Go through each message per fixture, validate ALL values.
+
+syslogParser.parse(messages[0], function(rfc3164BeforeTenth){
+ assert.ok(rfc3164BeforeTenth, 'RFC 3164 record parsed.');
+ assert.equal(rfc3164BeforeTenth.host, '10.0.0.99');
+});
Please sign in to comment.
Something went wrong with that request. Please try again.