Browse files

Adding new parse tests for each message type.

  • Loading branch information...
1 parent 6851341 commit 3828ff4c6d5a4f70a1204226376e790a34b2fe2f @squeeks committed Mar 3, 2013
Showing with 20 additions and 0 deletions.
  1. +20 −0 test/parse-3164.js
View
20 test/parse-3164.js
@@ -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');
+});

0 comments on commit 3828ff4

Please sign in to comment.