Permalink
Browse files

tinytest: Use indexOf for string matching

  • Loading branch information...
queso authored and glasser committed Feb 18, 2014
1 parent fc55d02 commit 45043c6996c9a8d48d2f38585f2c9598f952772c
Showing with 3 additions and 5 deletions.
  1. +3 −5 packages/tinytest/tinytest.js
@@ -255,11 +255,9 @@ _.extend(TestCaseResults.prototype, {
else if (typeof s === "object")
pass = v in s;
else if (typeof s === "string")
- for (var i = 0; i < s.length; i++)
- if (s.charAt(i) === v) {
- pass = true;
- break;
- }
+ if (s.indexOf(v) > -1) {
+ pass = true;
+ }
else
/* fail -- not something that contains other things */;
if (pass)

0 comments on commit 45043c6

Please sign in to comment.