Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'tests/libs/zbxcommon/zbx_token_find.yaml')
-rw-r--r--tests/libs/zbxcommon/zbx_token_find.yaml81
1 files changed, 81 insertions, 0 deletions
diff --git a/tests/libs/zbxcommon/zbx_token_find.yaml b/tests/libs/zbxcommon/zbx_token_find.yaml
index b3dac6e8c09..55a636f77c6 100644
--- a/tests/libs/zbxcommon/zbx_token_find.yaml
+++ b/tests/libs/zbxcommon/zbx_token_find.yaml
@@ -473,4 +473,85 @@ out:
token_type: ZBX_TOKEN_EXPRESSION_MACRO
expression: '{$VALUE:"context}"}*2'
return: SUCCEED
+---
+test case: 'Failure: {?}'
+in:
+ expression: '{?}'
+out:
+ return: FAIL
+---
+test case: 'Failure: {?"}'
+in:
+ expression: '{?"}'
+out:
+ return: FAIL
+---
+test case: 'Failure: {?"\"}'
+in:
+ expression: '{?"\"}'
+out:
+ return: FAIL
+---
+test case: 'Success: {?"abc"}'
+in:
+ expression: '{?"abc"}'
+out:
+ token: '{?"abc"}'
+ token_type: ZBX_TOKEN_EXPRESSION_MACRO
+ expression: '"abc"'
+ return: SUCCEED
+---
+test case: 'Success: {?"a\"b\"c"}'
+in:
+ expression: '{?"a\"b\"c"}'
+out:
+ token: '{?"a\"b\"c"}'
+ token_type: ZBX_TOKEN_EXPRESSION_MACRO
+ expression: '"a\"b\"c"'
+ return: SUCCEED
+---
+test case: 'Success: {?"}"}'
+in:
+ expression: '{?"}"}'
+out:
+ token: '{?"}"}'
+ token_type: ZBX_TOKEN_EXPRESSION_MACRO
+ expression: '"}"'
+ return: SUCCEED
+---
+test case: 'Success: {?{?}}'
+in:
+ expression: '{?{?}}'
+out:
+ token: '{?{?}'
+ token_type: ZBX_TOKEN_EXPRESSION_MACRO
+ expression: '{?'
+ return: SUCCEED
+---
+test case: 'Success: {?{host:key.func()}}'
+in:
+ expression: '{?{host:key.func()}}'
+out:
+ token: '{?{host:key.func()}}'
+ token_type: ZBX_TOKEN_EXPRESSION_MACRO
+ expression: '{host:key.func()}'
+ return: SUCCEED
+---
+test case: 'Success: {?{HOST.HOST}}'
+in:
+ expression: '{?{HOST.HOST}}'
+out:
+ token: '{?{HOST.HOST}'
+ token_type: ZBX_TOKEN_EXPRESSION_MACRO
+ expression: '{HOST.HOST'
+ return: SUCCEED
+---
+test case: 'Success: {?{$MACRO}}'
+in:
+ expression: '{?{$MACRO}}'
+out:
+ token: '{?{$MACRO}}'
+ token_type: ZBX_TOKEN_EXPRESSION_MACRO
+ expression: '{$MACRO}'
+ return: SUCCEED
...