/*jslint */
var linter = require('../lib/linter'),
    assert = require('assert');

/* test linter | merge */
var r = linter.merge({a: 1}, {b: 2});
assert.deepEqual(r, {a: 1, b: 2});

/* left side value wins in a merge */
r = linter.merge({a: 1}, {a: 2});
assert.deepEqual(r, {a: 1});

/* test: addDefaults set node, es5 if unset */
r = linter.addDefaults({white: false}, {color: true});
assert.deepEqual(r, {white: false, color: true, node: true, es5: true});

/* test: explicitly setting node, es5 prevents addDefaults from overriding */
r = linter.addDefaults({es5: false}, {node: false});
assert.deepEqual(r, {node: false, es5: false});

/* test: splitPredefs */
r = linter.splitPredefs({predef: "foo,bar,baz"});
assert.deepEqual(r, {predef: ['foo', 'bar', 'baz']});

r = linter.splitPredefs({predef: "foo,bar,baz"});
r = linter.splitPredefs({predef: "foo,bar,baz"});
assert.deepEqual(r, {predef: ['foo', 'bar', 'baz']});

@@ -2,16 +2,28 @@
 *jslint 
+stupid:true 
 */%0Avar l
@@ -911,28 +911,770 @@
 f: %5B'foo', 'bar', 'baz'%5D%7D);%0A
+%0A/* test: merge where one or more args is undefined */%0Ar = linter.merge(%7Ba: 1%7D, undefined);%0Aassert.deepEqual(r, %7Ba: 1%7D);%0A%0Ar = linter.merge(undefined, %7Ba: 1%7D);%0Aassert.deepEqual(r, %7Ba: 1%7D);%0A%0A/* test: reading jslintrc file from current dir */%0A(function () %7B%0A    'use strict';%0A    var oldDir = process.cwd(),%0A        fs = require('fs');%0A%0A    process.chdir('test');%0A%0A    /* create jslintrc file */%0A    fs.writeFileSync('jslintrc', '%7B%22foo%22: 1%7D');%0A%0A    r = linter.loadAndParseConfig('jslintrc');%0A    assert.deepEqual(r, %7Bfoo: 1%7D);%0A%0A    /* nonexistent .jslintrc file */%0A    r = linter.loadAndParseConfig('.jslintrc');%0A    assert.deepEqual(r, undefined);%0A%0A    /* remove the jslintrc file */%0A    fs.unlink('jslintrc');%0A    process.chdir(oldDir);%0A%7D());%0A

add tests for local config file functionality