From 2273e0174f425c91b8363e8d445e48643408e4fd Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Thu, 3 Jul 2014 11:53:12 -0400 Subject: [PATCH] Test colors and comments --- test/color.test.js | 13 +++++++++++++ test/comment.test.js | 14 ++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 test/color.test.js create mode 100644 test/comment.test.js diff --git a/test/color.test.js b/test/color.test.js new file mode 100644 index 0000000..ea5f8a9 --- /dev/null +++ b/test/color.test.js @@ -0,0 +1,13 @@ +var assert = require('assert'); +var tree = require('../lib/carto/tree.js'); +require('../lib/carto/tree/color'); + +describe('Color', function() { + describe('basic functionality', function() { + it('should be constructed', function() { + var f = new tree.Color([0, 0, 0], 1); + assert.deepEqual(f.toHSL(), {"h":0,"s":0,"l":0,"a":1}); + assert.ok(f); + }); + }); +}); diff --git a/test/comment.test.js b/test/comment.test.js new file mode 100644 index 0000000..bc6b01e --- /dev/null +++ b/test/comment.test.js @@ -0,0 +1,14 @@ +var assert = require('assert'); +var tree = require('../lib/carto/tree.js'); +require('../lib/carto/tree/comment'); + +describe('Comment', function() { + describe('basic functionality', function() { + it('should be constructed', function() { + var f = new tree.Comment('hello world'); + assert.deepEqual(f.toString(), ''); + assert.deepEqual(f.ev(), f); + assert.ok(f); + }); + }); +});