From 1894042e17807ef91ea6116ae85941acf289a255 Mon Sep 17 00:00:00 2001 From: David Sancho Moreno Date: Sun, 3 Mar 2024 22:06:22 +0100 Subject: [PATCH] Fix tests with lastIndex -> index --- test/suite.ml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/suite.ml b/test/suite.ml index fa6ef93..6d3de5c 100644 --- a/test/suite.ml +++ b/test/suite.ml @@ -173,19 +173,19 @@ let () = assert_result (RegExp.captures result) [| "0" |]); test "with y (sticky)" (fun () -> let regex = RegExp.compile "foo" "y" in - assert_int (RegExp.lastIndex regex) 0; + assert_int (RegExp.index regex) 0; let input = "foofoofoo" in let result = RegExp.exec regex input in - assert_int (RegExp.lastIndex regex) 3; + assert_int (RegExp.index regex) 3; assert_result (RegExp.captures result) [| "foo" |]; let result = RegExp.exec regex input in - assert_int (RegExp.lastIndex regex) 6; + assert_int (RegExp.index regex) 6; assert_result (RegExp.captures result) [| "foo" |]; let result = RegExp.exec regex input in - assert_int (RegExp.lastIndex regex) 9; + assert_int (RegExp.index regex) 9; assert_result (RegExp.captures result) [| "foo" |]; let result = RegExp.exec regex input in - assert_int (RegExp.lastIndex regex) 0; + assert_int (RegExp.index regex) 0; assert_result (RegExp.captures result) [||]); test "groups" (fun () -> let regex = RegExp.compile "(xyz)" "" in