/*
for test cases
189641
public Sequence createSequenceofLength(int length,char base)
	{
		Sequence sequence=new Sequence();
		byte[] sequenceByte=new byte[length];
		for(int i=0;i<length;i++)
		{
			sequenceByte[i]=(byte)base;
	    }
		
		sequence.setSequence(ByteBuffer.wrap(sequenceByte));
	    return sequence;
	}
188450
function(parent, name, type) {
			if (/^[0-9]+$/.test(name)) {
        return parent + "[" + name + "]";
      } else if (JavaScriptCompiler.isValidJavaScriptVariableName(name)) {
	    	return parent + "." + name;
			}
			else {
				return parent + "['" + name + "']";
      }
    }
948611
function(path) {
            const { node } = path;

            // Need to be careful of side-effects.
            if (!t.isIdentifier(node.discriminant)) {
              return;
            }

            if (!node.cases.length) {
              return;
            }

            const exprTestPairs = [];
            let fallThru = [];
            let defaultExpr;
            for (const switchCase of node.cases) {
              if (!switchCase.test) {
                if (switchCase.consequent.length !== 1) {
                  return;
                }
                if (!t.isExpressionStatement(switchCase.consequent[0])) {
                  return;
                }
                defaultExpr = switchCase.consequent[0].expression;
                continue;
              }

              if (!switchCase.consequent.length) {
                fallThru.push(switchCase.test);
                continue;
              }

              const [cons, breakStatement] = switchCase.consequent;
              if (switchCase === node.cases[node.cases.length - 1]) {
                if (breakStatement && !t.isBreakStatement(breakStatement)) {
                  return;
                }
              } else if (!t.isBreakStatement(breakStatement)) {
                return;
              }

              if (
                !t.isExpressionStatement(cons) ||
                switchCase.consequent.length > 2
              ) {
                return;
              }

              let test = t.binaryExpression(
                "===",
                node.discriminant,
                switchCase.test
              );
              if (fallThru.length && !defaultExpr) {
                test = fallThru.reduceRight(
                  (right, test) =>
                    t.logicalExpression(
                      "||",
                      t.binaryExpression("===", node.discriminant, test),
                      right
                    ),
                  test
                );
              }
              fallThru = [];

              exprTestPairs.push([test, cons.expression]);
            }

            if (fallThru.length) {
              return;
            }

            const cond = exprTestPairs.reduceRight(
              (alt, [test, cons]) => t.conditionalExpression(test, cons, alt),
              defaultExpr || VOID_0
            );

            path.replaceWith(cond);
          }
557400
function parseSwitchCase(test) {
        var consequent = [],
            statement;

        while (index < length) {
            if (match('}') || matchKeyword('default') || matchKeyword('case')) {
                break;
            }
            statement = parseStatement();
            if (typeof statement === 'undefined') {
                break;
            }
            consequent.push(statement);
        }

        return {
            type: Syntax.SwitchCase,
            test: test,
            consequent: consequent
        };
    }
157497
private boolean makeComplete( TestCaseDef testCase, VarTupleSet tuples, List<VarDef> vars)
    {
    boolean complete;

    // Test case still missing a required property?
    if( testCase.isSatisfied())
      {
      // No, complete bindings for remaining variables
      complete = completeSatisfied( testCase, tuples, vars);
      }
    else
      {
      // Yes, find tuples that contain satisfying bindings.
      int prevBindings = testCase.getBindingCount();
      Iterator<Tuple> satisfyingTuples = getSatisfyingTuples( testCase, tuples);
      for( complete = false;

           satisfyingTuples.hasNext()
             && !(
               // Does this tuple lead to satisfaction of all current test case conditions?
               makeSatisfied( testCase, tuples, satisfyingTuples.next())

               // Can we complete bindings for remaining variables?
               && (complete = completeSatisfied( testCase, tuples, vars)));

           // No, try next tuple
           testCase.revertBindings( prevBindings));
      }

    return complete;
    }
143968
function(cond){
    var test = cond.test;
    this.buf.push('if (' + test + ') {');
    this.visit(cond.consequent, cond);
    this.buf.push('}')
    if (cond.alternate) {
      if (cond.alternate.type === 'Conditional') {
        this.buf.push('else')
        this.visitConditional(cond.alternate);
      } else {
        this.buf.push('else {');
        this.visit(cond.alternate, cond);
        this.buf.push('}');
      }
    }
  }
148467
function (test) {
    var ret = []
    for (var n = 0; n < batchTest.length; n++) {
      if (batchTest[n] === test) continue
      ret.push(batchTest[n])
    }
    batchTest = ret
  }
1147465
function(input) {
		var needstesting = !this._matches.length;
		if (needstesting || this._matches.every(function(match) {
			return match.$instanceid !== input.$instanceid;
		})) {
			return this._maybeinput(input);
		}
		return false;
	}
302308
function endsWith(testStr, endsStr) {
        var index = testStr.lastIndexOf(endsStr);
        if (index < 0) {
            return false;
        }
        if (endsStr.length + index == testStr.length) {
            return true;
        }
        return false;
    }
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);
      });
    });
  }
335568
function usecase(name) {
        let $queue = [];
        let $run;
        return { use };
        function use(arg) {
            let q = [].concat(arg);
            q = $enhancer ? q.map((t) => $enhancer(name, t)) : q;
            q.forEach(t => $queue.push(t));
            return $run || (() => {
                $run = run;
                $run.use = use;
                return $run;
            })();
        }
        function run() {
            next($queue[Symbol.iterator](), arguments[0]);
        }
        ;
    }
568851
function check(result, test) {

  const CHECKERS = [ _checkExitCode, _checkOutput, _checkStdout, _checkStderr ];
  var errors = [];

  CHECKERS.forEach(function (checker) {
    var error = checker(result, test);
    if (error) {
      errors.push(error);
    }
  });
  
  return errors;
}
1116124
function find(test, cwd, callback, one) {
  var results = []
  var current

  test = augment(test)

  if (!callback) {
    callback = cwd
    cwd = null
  }

  current = cwd ? resolve(cwd) : process.cwd()

  once()

  // Test a file and check what should be done with the resulting file.
  function handle(filePath) {
    var file = toVFile(filePath)
    var result = test(file)

    if (mask(result, INCLUDE)) {
      if (one) {
        callback(null, file)
        return true
      }

      results.push(file)
    }

    if (mask(result, BREAK)) {
      callback(null, one ? null : results)
      return true
    }
  }

  // Check one directory.
  function once(child) {
    if (handle(current) === true) {
      return
    }

    readdir(current, onread)

    function onread(error, entries) {
      var length = entries ? entries.length : 0
      var index = -1
      var entry

      if (error) {
        entries = []
      }

      while (++index < length) {
        entry = entries[index]

        if (entry !== child && handle(resolve(current, entry)) === true) {
          return
        }
      }

      child = current
      current = dirname(current)

      if (current === child) {
        callback(null, one ? null : results)
        return
      }

      once(basename(child))
    }
  }
}
414187
function caseOf (/* ...args, matcher */) {
    var args = slice.call(arguments, 0, -1);
    var matcher = arguments[arguments.length - 1];
    var context = this === exports ? null : this;
  
    if (typeof matcher === "function") {
      if (!matcher.__matchChain) throw new Error("Not a matcher function");
      return matcher.apply(context, args);
    }
  
    return pattern(matcher).apply(context, args);
  }
326536
function (test) {
        if (test.callback) {
            test.callback.fn.apply(test.callback.scope, test.callback.args);
        }
    }
139666
function (testObject) {
        if (testObject instanceof YUITest.TestSuite || testObject instanceof YUITest.TestCase) {
            this.items.push(testObject);
        }
        return this;
    }
1054312
function PascalCase()
    {
        $key = (string) $this;
        
        ## prefix and postfix __ remains; like: __this__
        
        $pos = 'prefix';
        $prefix = '';
        $posfix = '';
        for ($i = 0; $i <= strlen($key)-1; $i++) {
            if ($key[$i] == '_')
                $$pos.='_';
            else {
                $posfix = ''; // reset posix, _ may found within string
                $pos  = 'posfix';
            }
        }

        $r = str_replace(' ', '', ucwords(str_replace('_', ' ', $key)));
        $r = $prefix.$r.$posfix;
        return new self($r);
    }