From b70a99d66afc8bd88de95d20685549c7d444f66e Mon Sep 17 00:00:00 2001 From: Petr Pucil Date: Tue, 27 Aug 2024 14:36:56 +0200 Subject: [PATCH] ExprStrOps: add `str.substring(0, 0)` case See https://github.com/kaitai-io/kaitai_struct_compiler/pull/277#issuecomment-2000631416 --- formats/expr_str_ops.ksy | 2 ++ spec/ks/expr_str_ops.kst | 2 ++ 2 files changed, 4 insertions(+) diff --git a/formats/expr_str_ops.ksy b/formats/expr_str_ops.ksy index 6337bd6ae..366999b4d 100644 --- a/formats/expr_str_ops.ksy +++ b/formats/expr_str_ops.ksy @@ -16,6 +16,8 @@ instances: value: one.substring(2, 5) one_substr_3_to_3: value: one.substring(3, 3) + one_substr_0_to_0: + value: one.substring(0, 0) two: value: '"0123456789"' diff --git a/spec/ks/expr_str_ops.kst b/spec/ks/expr_str_ops.kst index 89e12b42e..cc9d7a6f3 100644 --- a/spec/ks/expr_str_ops.kst +++ b/spec/ks/expr_str_ops.kst @@ -13,6 +13,8 @@ asserts: expected: '"o|b"' - actual: one_substr_3_to_3 expected: '""' + - actual: one_substr_0_to_0 + expected: '""' - actual: two expected: '"0123456789"'