(function(window) {

  module('Benchmark');

  test('Benchmark.platform', function() {
    equals(navigator.userAgent, String(Benchmark.platform), 'default value');
  });

  if (window.require != null) {
    test('require("benchmark")', function() {
      equals((Benchmark2 || { }).version, Benchmark2.version, 'require("benchmark")');
    });

    test('require("platform")', function() {
      var bench = Benchmark2 || { },
          platform = bench.platform || { };
      equals(typeof platform.name, 'string', 'auto required');
    });
  }

  /*--------------------------------------------------------------------------*/

  module('Benchmark.join');

  test('basic', function() {
    var o = ['a', 'b', 'c'];
    equals(Benchmark.join(o), 'a,b,c', 'default separator 1');
    equals(Benchmark.join(o, '|', '@'), 'a|b|c', 'custom separator 1');

    o = { 'a': 'apple', 'b': 'ball', 'c': 'cat' };
    equals(Benchmark.join(o), 'a: apple,b: ball,c: cat', 'default separator 2');
    equals(Benchmark.join(o, '|', '@'), 'a@apple|b@ball|c@cat', 'custom separator 2');
  });

  test('array-like-object', function() {
    var o = { '1': 'b', '2': 'c', 'length': 3 };
    equals(Benchmark.join(o), 'b,c', 'default separator 1');
  });

  /*--------------------------------------------------------------------------*/

  module('Benchmark.map');

  test('basic', function() {
    var args,
        slice = [].slice,
        o = ['a', 'b', 'c'];

    var result = Benchmark.map(o, function(value, index) {
      args || (args = slice.call(arguments));
      return index;
    });

    deepEqual(result, [0, 1, 2], 'basic');
    deepEqual(args, ['a', 0, o], 'passed arguments to callback');
  });

  test('array-like-object', function() {
    var o = { '1': 'b', '2': 'c', 'length': 3 };
    var result = Benchmark.map(o, function(value, index) {
      return index;
    });

    deepEqual(result, [1, 2], 'basic');
  });

  /*--------------------------------------------------------------------------*/

  module('Benchmark.pluck');

  test('basic', function() {
    var o = [document.documentElement, document.getElementsByTagName('head')[0]];
    var result = Benchmark.pluck(o, 'nodeName');

    deepEqual(result, ['HTML', 'HEAD'], 'basic');
  });

  test('array-like-object', function() {
    var o = { '1': document.getElementsByTagName('head')[0], '2': document.body, 'length': 3 };
    var result = Benchmark.pluck(o, 'nodeName');

    deepEqual(result, ['HEAD', 'BODY'], 'basic');
  });

  /*--------------------------------------------------------------------------*/

  module('Benchmark.reduce');

  test('basic', function() {
    var args,
        slice = [].slice,
        o = ['a', 'b', 'c'];

    var result = Benchmark.reduce(o, function(string, value, index) {
      args || (args = slice.call(arguments));
      return string + value;
    }, '');

    equals(result, 'abc', 'accumulation correct');
    deepEqual(args, ['', 'a', 0, o], 'passed arguments to callback');
    args = null;

    Benchmark.reduce(o, function() {
      args || (args = slice.call(arguments));
    });
    deepEqual(args, ['a', 'b', 1, o], 'no initial value');
  });

  test('array-like-object', function() {
    var o = { '1': 'b', '2': 'c', 'length': 3 };
    var result = Benchmark.reduce(o, function(string, value, index) {
      return string + value;
    });

    equals(result, 'bc', 'accumulation correct');
  });

  /*--------------------------------------------------------------------------*/

  module('Benchmark#emit');

  test('event object', function() {
    var args = [],
        bench = new Benchmark(function() { }),
        event = { 'type': 'custom' },
        listener2 = function(event) { event.listener2 = 1 };

    bench.on('custom', function(event) { event.touched = 1; });
    bench.emit(event);
    bench.events = { };
    ok(event.touched, 'emit custom event object');

    bench.on('type', function(eventObj) { event = eventObj; });
    bench.emit('type');
    bench.events = { };
    equals(event.type, 'type', 'emit event.type');

    bench.on('args', function() { args = args.slice.call(arguments, 1); });
    bench.emit('args', 'a', 'b', 'c');
    bench.events = { };
    deepEqual(args, ['a', 'b', 'c'], 'emit curried arguments');

    ok(bench.emit('empty'), 'emit empty successful');

    bench.on('success', function() { return 'bogus'; });
    ok(bench.emit('success'), 'emit successful');

    bench.on('success', function() { return false; });
    ok(!bench.emit('success'), 'emit unsuccessful');
    bench.events = { };

    bench.on('shallowclone', function(eventObject) {
      event = eventObject;
      bench.removeListener(event.type, listener2);
    })
    .on('shallowclone', listener2)
    .emit('shallowclone');
    bench.events = { };
    ok(event.listener2, 'emit shallow cloned listeners');
  });

}(this));
@@ -615,32 +615,531 @@
 ------------*/%0A%0A
+  module('Benchmark.indexOf');%0A%0A  test('basic', function() %7B%0A    var o = %5B'a', 'b', 'c'%5D;%0A    equals(Benchmark.indexOf(o, 'b'), 1, 'basic');%0A    equals(Benchmark.indexOf(o, new String('b')), -1, 'strict');%0A  %7D);%0A%0A  test('array-like-object', function() %7B%0A    var o = %7B '1': 'b', '2': 'c', 'length': 3 %7D;%0A    equals(Benchmark.indexOf(o, 'c'), 2, 'basic');%0A    equals(Benchmark.indexOf(o, 'a'), -1, 'not found');%0A  %7D);%0A%0A  /*--------------------------------------------------------------------------*/%0A%0A
   module('Benchm
@@ -2558,24 +2558,39 @@
 ) %7B%0A    var 
+undef,%0A        
 o = %5Bdocumen
@@ -2651,16 +2651,17 @@
 ')%5B0%5D%5D;%0A
+%0A
     var 
@@ -2693,33 +2693,32 @@
 o, 'nodeName');%0A
-%0A
     deepEqual(re
@@ -2742,32 +2742,142 @@
 EAD'%5D, 'basic');
+%0A%0A    result = Benchmark.pluck(o, 'nonexistent');%0A    deepEqual(result, %5Bundef, undef%5D, 'undefined property');
 %0A  %7D);%0A%0A  test('

Add unit tests for Benchmark.indexOf. [jddalton]