Preparation Code Preparation HTML (this will be inserted in the <body>
of a valid HTML5 document in standards mode) (useful when testing DOM operations or including libraries) <script >
var str = 'inline-block' ;
var arr = ['inline' , 'inline-block' , 'inline-table' , 'ruby' ];
var obj = {'inline' : true , 'inline-block' : true , 'inline-table' : true , 'ruby' : true };
</script >
Setup JS var precompiledRegex = /(inline|ruby)/ ;
Teardown JS
Test cases
Test #1 Title *
Async
Code * /(inline|ruby)/.test (str);
Test #2 Title *
Async
Code * str.search (/(inline|ruby)/ ) > -1 ;
Title *
Async
Code * str.match (/(inline|ruby)/ ).length > 0 ;
Title *
Async
Code * str.indexOf (/(inline|ruby)/ ) > -1 ;
Title *
Async
Code * precompiledRegex.test (str);
Title *
Async
Code * str.search (precompiledRegex) > -1 ;
Title *
Async
Code * str.match (precompiledRegex).length > 0 ;
Title *
Async
Code * str.indexOf (precompiledRegex) > -1 ;
Title *
Async
Code * str.indexOf ('inline' ) > -1 || str.indexOf ('ruby' ) > -1 ;
Title *
Async
Code * str === "inline" || str === "inline-block" || str === "inline-table" || str === "ruby" ;
Title *
Async
Code * arr.indexOf (str) > -1 ;
Title *
Async
Code * obj[str] === true ;