diff --git a/src/interpreter/primitive_props.rs b/src/interpreter/primitive_props.rs index 560440d..0bb0028 100644 --- a/src/interpreter/primitive_props.rs +++ b/src/interpreter/primitive_props.rs @@ -277,14 +277,14 @@ pub fn get_prim_prop(target: Value, name: String) -> Result= 0 { - target_len - raw_index + raw_index } else { - -raw_index + target_len + raw_index } as usize; Ok(Value::bool( diff --git a/tests/test.rs b/tests/test.rs index 54a7d49..2a1c0b7 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -3964,9 +3964,9 @@ mod primitive_props { let str = "hello" let empty = "" <: [ - // str.ends_with("", 3), str.ends_with("lo", 5), - // str.ends_with("ll", 4), str.ends_with("he", 2), - // str.ends_with("ll", -1), str.ends_with("he", -3), + str.ends_with("", 3), str.ends_with("lo", 5), + str.ends_with("ll", 4), str.ends_with("he", 2), + str.ends_with("ll", -1), str.ends_with("he", -3), str.ends_with("he", 5), str.ends_with("lo", 3), str.ends_with("lo", -6), str.ends_with("", -7), str.ends_with("lo", 6), str.ends_with("", 7), @@ -3977,12 +3977,12 @@ mod primitive_props { assert_eq!( res, arr([ - // bool(true), - // bool(true), - // bool(true), - // bool(true), - // bool(true), - // bool(true), + bool(true), + bool(true), + bool(true), + bool(true), + bool(true), + bool(true), bool(false), bool(false), bool(false),