Appends a new test object (TestSuite, TestCase, or test function name) as a child
of this node.
@param {Variant} testObject A TestSuite, TestCase, or the name of a test function.
@return {Void}
172837
function (testObject){
                var node = new TestNode(testObject);
                if (this.firstChild === null){
                    this.firstChild = this.lastChild = node;
                } else {
                    this.lastChild.next = node;
                    this.lastChild = node;
                }
                node.parent = this;
                return node;
            }
1046707
protected void append(Object object, int index) {
		if (object == null)
			return;
		if (object instanceof String) {
			append((String) object, index);
		} else if (object instanceof StringConcatenation) {
			StringConcatenation other = (StringConcatenation) object;
			appendSegments(index, other.getSignificantContent(), other.lineDelimiter);
		} else if (object instanceof StringConcatenationClient) {
			StringConcatenationClient other = (StringConcatenationClient) object;
			other.appendTo(new SimpleTarget(this, index));
		} else {
			final String text = getStringRepresentation(object);
			if (text != null) {
				append(text, index);
			}
		}
	}
300130
function (data) {
    this.variationCount = -1;
    this.xml[0].children[this.testIdx].children.push({
      name: 'testcase',
      children: [],
      attrs: {
        classname: this.xml[0].children[this.testIdx].attrs.name,
        name: data.name
      }
    });

    return this;
  }
775267
function createElement(name, props) {
		var c = document,
			d = c.createElement(name);
		if (props && "[object Object]" === Object.prototype.toString.call(props)) {
			var e;
			for (e in props)
				if ("html" === e) d.innerHTML = props[e];
				else if ("text" === e) {
				var f = c.createTextNode(props[e]);
				d.appendChild(f);
			} else d.setAttribute(e, props[e]);
		}
		return d;
	}
124028
public void insert(SimpleTest test, Object target) {
    if (size == ranges.length) {
      RangeEntry[] tmp = new RangeEntry[2*size];
      System.arraycopy(ranges,0,tmp,0,size);
      ranges = tmp;
    }

    ranges[size] = new RangeEntry(test, target);
    size++;
  }
248506
function _suite(description, cb) {
            var test = new this(description, {});
            var it = test._addAction;
            _(["suite", "test", "timeout", "getAction", "beforeAll", "beforeEach",
                "afterAll", "afterEach", "context", "get", "set", "skip"]).forEach(function (key) {
                    it[key] = test[key];
                });
            cb(test);
            return test;
        }
688461
function (object) {
        var methodName;

        methodName = this.test(object, true);
        if (methodName !== true) {
            throw new exports.NotImplementedError({
                code: 'interface',
                message: 'Object %(object) does not implement %(interface)#%(method)()',

                //Additional information
                interface: this.name,
                object: object,
                method: methodName
            });
        }
        return this;
    }
670817
public HashCodeBuilder append(final Object object) {
        if (object == null) {
            iTotal = iTotal * iConstant;

        } else {
            if (object.getClass().isArray()) {
                // factor out array case in order to keep method small enough
                // to be inlined
                appendArray(object);
            } else {
                iTotal = iTotal * iConstant + object.hashCode();
            }
        }
        return this;
    }
196098
function results2xml(errorsNumber) {
        errorCount = 0;
        var result = ['<testsuite name="root" errors="' + errorsNumber + '">'];
        Object.keys(results).forEach(function(suite) {
            result.push('\r\n\t<testsuite name="' + escapeXML(suite) + '">');
            Object.keys(results[suite]).forEach(function(testcase) {
                result.push('\r\n\t\t<testcase name="' +
                escapeXML(testcase) + '">');
                results[suite][testcase].forEach(function(err) {
                    result.push('\r\n\t\t\t<failure>\r\n\t\t\t\t' +
                    escapeXML(JSON.stringify(err)) +
                    '\r\n\t\t\t</failure>');
                });
                result.push('\r\n\t\t</testcase>');
            });
            result.push('\r\n\t</testsuite>\n');
        });
        result.push('</testsuite>\n');
        return result.join('');
    }
1284332
def addUnexpectedSuccess(self, test):
        
        super().addUnexpectedSuccess(test)
        self.test_info(test)
        self._call_test_results('addUnexpectedSuccess', test)
1323845
function (object) {
    if (typeof object !== 'object' || !object || Array.isArray(object)) {
      "development" !== 'production' ? warning(false, 'React.addons.createFragment only accepts a single object. Got: %s', object) : void 0;
      return object;
    }
    if (ReactElement.isValidElement(object)) {
      "development" !== 'production' ? warning(false, 'React.addons.createFragment does not accept a ReactElement ' + 'without a wrapper object.') : void 0;
      return object;
    }

    !(object.nodeType !== 1) ? "development" !== 'production' ? invariant(false, 'React.addons.createFragment(...): Encountered an invalid child; DOM elements are not valid children of React components.') : _prodInvariant('0') : void 0;

    var result = [];

    for (var key in object) {
      if ("development" !== 'production') {
        if (!warnedAboutNumeric && numericPropertyRegex.test(key)) {
          "development" !== 'production' ? warning(false, 'React.addons.createFragment(...): Child objects should have ' + 'non-numeric keys so ordering is preserved.') : void 0;
          warnedAboutNumeric = true;
        }
      }
      ReactChildren.mapIntoWithKeyPrefixInternal(object[key], result, key, emptyFunction.thatReturnsArgument);
    }

    return result;
  }
22962
private void appendConsoleLogging(Node root) {
		if (logDebug && consoleDebugOutput.size() > 0) {
			// Emit code to call console.log on the client
			Node node = root;
			if (node.getType() == Token.BLOCK) {
				node = node.getFirstChild();
			}
			if (node.getType() == Token.SCRIPT) {
				if (source == null) {
					// This is non-source build.  Modify the AST
					Node firstNode = node.getFirstChild();
					for (List<String> entry : consoleDebugOutput) {
						Node call = new Node(Token.CALL,
								new Node(Token.GETPROP,
										Node.newString(Token.NAME, "console"),  //$NON-NLS-1$
										Node.newString(Token.STRING, "log") //$NON-NLS-1$
										)
								);
						for (String str : entry) {
							call.addChildToBack(Node.newString(str));
						}
						node.addChildAfter(new Node(Token.EXPR_RESULT, call), firstNode);
					}
				} else {
					// Non-source build.  Modify the AST
					for (List<String> entry : consoleDebugOutput) {
						StringBuffer sb = new StringBuffer("console.log("); //$NON-NLS-1$
						int i = 0;
						for (String str : entry) {
							sb.append((i++ == 0 ? "" : ",") + "\"" + StringUtil.escapeForJavaScript(str) + "\""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
						}
						sb.append(");\n"); //$NON-NLS-1$
						source.appendln(sb.toString());
					}
				}
			}
		}
	}
690496
function (obj) {
        if (
            !obj
            || {}.toString.call(obj) !== '[object Object]'
            || obj.nodeType
            || obj.setInterval
        ) {
            return false
        }

        var hasOwn              = {}.hasOwnProperty;
        var hasOwnConstructor   = hasOwn.call(obj, 'constructor');
        // added test for node > v6
        var hasMethodPrototyped = ( typeof(obj.constructor) != 'undefined' ) ? hasOwn.call(obj.constructor.prototype, 'isPrototypeOf') : false;


        if (
            obj.constructor && !hasOwnConstructor && !hasMethodPrototyped
        ) {
            return false
        }

        //Own properties are enumerated firstly, so to speed up,
        //if last one is own, then all properties are own.
        var key;
        return key === undefined || hasOwn.call(obj, key)
    }
835236
function (name, test) {
                        try {
                            if (_.isFunction (test)) {                               test () }
                                                else { _.each (test, function (fn) { fn () }) } }
                        catch (e) {
                            if (_.isAssertionError (e)) { var printedName = ((_.isArray (name) && name) || [name]).join ('.')
                                                          console.log (printedName + ':', e.message, '\n' + _.times (printedName.length, _.constant ('~')).join ('') + '\n')
                                                         _.each (e.notMatching, function (x) { console.log ('  •', x) }) }
                            throw e } }
503644
function (baseUrl, callback) {
    callback = callback || function (error, results) {
      if (error) {
        console.error.apply(console,
          error.stack ? [ error.stack ] : [ 'Error:', error ]);
      }
      var total = results.passed.length + results.failed.length;
      console.log('Results: ' + results.passed.length + '/' + total + ' test' +
        (total === 1 ? '' : 's') + ' passed.');
      if (results.failed.length > 0) {
        console.error('Failed:', jsonStringifyWithFunctions(results.failed));
      }
    };

    var results = {
      failed: [],
      passed: []
    };

    this.exportAllTests(baseUrl, function runNextTest (tests) {
      if (tests.length === 0) {
        callback(null, results);
        return;
      }

      var i = Math.floor(Math.random() * tests.length);
      var test = tests.splice(i, 1)[0];
      test(function (error, testResults) {
        if (testResults) {
          results.failed = results.failed.concat(testResults.failed);
          results.passed = results.passed.concat(testResults.passed);
        }
        if (error) {
          callback(error, results);
          return;
        }
        runNextTest(tests);
      });
    });
  }
620029
function(description, body) {
      extend(this, {
        body: body,
        description: description,
        assertions: [],
        
        // Add passing assertion
        
        pass : function(message) {
          this.assertions.push({ passed: true, message: message })
          if (JSpec.assert) ++JSpec.stats.passes
        },
        
        // Add failing assertion
        
        fail : function(message) {
          this.assertions.push({ passed: false, message: message })
          if (JSpec.assert) ++JSpec.stats.failures
        },
                
        // Run deferred assertions
        
        runDeferredAssertions : function() {
          each(this.assertions, function(assertion){
            if (assertion.defer) assertion.run().report(), hook('afterAssertion', assertion)
          })
        },
        
        // Find first failing assertion

        failure : function() {
          return find(this.assertions, function(assertion){
            return !assertion.passed
          })
        },

        // Find all failing assertions

        failures : function() {
          return select(this.assertions, function(assertion){
            return !assertion.passed
          })
        },

        // Weither or not the spec passed

        passed : function() {
          return !this.failure()
        },

        // Weither or not the spec requires implementation (no assertions)

        requiresImplementation : function() {
          return this.assertions.length == 0
        },

        // Sprite based assertions graph

        assertionsGraph : function() {
          return map(this.assertions, function(assertion){
            return '<span class="assertion ' + (assertion.passed ? 'passed' : 'failed') + '"></span>'
          }).join('')
        }
      })
    }
1001539
def initChild(cls, obj, name, subContext, parent = None):
    """"""
    addr = statsId(obj)
    if addr not in cls.containerMap:
      if not parent:
        # Find out the parent of the calling object by going back through the call stack until a self != this.
        f = inspect.currentframe()
        while not cls.__getSelf(f):
          f = f.f_back
        this = cls.__getSelf(f)
        f = f.f_back
        while cls.__getSelf(f) == this or not cls.__getSelf(f):
          f = f.f_back
        parent = cls.__getSelf(f)

      # Default subcontext to an autoincrementing ID.
      if subContext is None:
        cls.subId += 1
        subContext = cls.subId

      if subContext is not '':
        path = '%s/%s' % (name, subContext)
      else:
        path = name

      # Now that we have the name, create an entry for this object.
      cls.parentMap[addr] = parent
      container = cls.getContainerForObject(statsId(parent))
      if not container and isinstance(parent, unittest.TestCase):
        cls.init(parent, '/test-case')
      cls.containerMap[addr] = cls.__getStatContainer(path, cls.getContainerForObject(statsId(parent)))
    return cls.containerMap[addr]