'use strict';

var lab = exports.lab = require('lab').script();
var code = require('code');

var taskTree = require('../lib/versioned/^3.7.0/taskTree');

lab.experiment('taskTree()', function() {

  lab.test('forms a tree properly', function(done) {
    code.expect(taskTree).to.exist(); // Lol shutup jshint

    var tasks = {
      test: {
        dep: ['abc', 'def'],
      },
      abc: {
        dep: ['def'],
      },
      def: {
        dep: [],
      },
    };

    var expectTree = {
      nodes: [
        {
          label: 'test',
          nodes: ['abc', 'def'],
        },
        {
          label: 'abc',
          nodes: ['def'],
        },
        {
          label: 'def',
          nodes: [],
        },
      ],
    };

    code.expect(taskTree(tasks)).to.deep.equal(expectTree);
    done();
  });
});

@@ -346,34 +346,36 @@
      dep: %5B'
-abc
+dep1
 ', 'de
-f
+p2
 '%5D,%0A      %7D,
@@ -381,19 +381,21 @@
 ,%0A      
-abc
+test2
 : %7B%0A    
@@ -403,25 +403,26 @@
    dep: %5B'de
-f
+p3
 '%5D,%0A      %7D,
@@ -428,19 +428,21 @@
 ,%0A      
-def
+test3
 : %7B%0A    
@@ -567,18 +567,20 @@
 : %5B'
-abc
+dep1
 ', 'de
-f
+p2
 '%5D,%0A
@@ -622,11 +622,13 @@
 l: '
-abc
+test2
 ',%0A 
@@ -647,17 +647,18 @@
 es: %5B'de
-f
+p3
 '%5D,%0A    
@@ -696,11 +696,13 @@
 l: '
-def
+test3
 ',%0A 

Clarify taskTree tests