source: trip-planner-front/node_modules/buffer-indexof/test/multibyteneedle.js@ 8d391a1

Last change on this file since 8d391a1 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 404 bytes
RevLine 
[6a3a178]1var test = require('tape')
2var bindexof = require('../')
3
4test("can find mutibyte needles",function(t){
5
6 t.equals(bindexof(new Buffer("hi"),new Buffer("hi")),0,'should find multibyte needle when its the whole buffer')
7
8 // https://github.com/soldair/node-buffer-indexof/issues/2
9 t.equals(bindexof(new Buffer("aaba"), new Buffer("ab")),1,'should find multibyte needle in haystack')
10
11
12 t.end();
13
14
15})
Note: See TracBrowser for help on using the repository browser.