// Copyright 2020 the V8 project authors. All rights reserved.// Use of this source code is governed by a BSD-style license that can be// found in the LICENSE file.// Test to ensure the calling of containing() won't impact the calling of// the next() method.constsegmenter=newIntl.Segmenter();constman_light_skin_tone_red_hair="\uD83D\uDC68\uD83C\uDFFB\u200D\uD83E\uDDB0";constinput="ABCD"+man_light_skin_tone_red_hair;constsegments=segmenter.segment(input);for(leti=0;i<input.length;i++){letidx=i<4?i:4;letexpectation=i<4?input[i]:man_light_skin_tone_red_hair;assertEquals({segment:expectation,index:idx,input},segments.containing(i));letresult=[];for(letvofsegments){result.push(v.segment);result.push(":");// Ensure the value n passing into segments.containing(n) will not impact// the result of next().assertEquals({segment:expectation,index:idx,input},segments.containing(i));}assertEquals("A:B:C:D:"+man_light_skin_tone_red_hair+":",result.join(""));}