source: trip-planner-front/node_modules/buffer-indexof/test/multibyteneedle.js@ 188ee53

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

initial commit

  • Property mode set to 100644
File size: 404 bytes
Line 
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.