Source
expression'{{?{{?{{?{{?{{?{{?{{?{{?{{?{{?{{?{{?{{?{{?{{?{{?{{?{{?{{?{{?{{?{{?{{?{{?{{?{{?{{?{{?{{?{{?{?1 + 2}'
---
test case"successfully found low-level discovery function macros token"
in
expression'{{#IFALIAS}.regsub("(.*)_([0-9]+)", \1)}'
out
return SUCCEED
token_type ZBX_TOKEN_LLD_FUNC_MACRO
token_l0
token_r39
macro_l1
macro_r10
func_l12
func_r38
func_param_l18
func_param_r38
---
test case"invalid low-level discovery function macros token"
in
expression'{{#}.regsub("(.*)_([0-9]+)", \1)}'
out
return'FAIL'
---
test case"successfully found function macros token"
in
expression'{{ITEM.LASTVALUE}.regsub("App([0-9]) ([a-z]+)","App\1")}'
out
return SUCCEED
token_type ZBX_TOKEN_FUNC_MACRO
token_l0
token_r55
macro_l1
macro_r16
func_l18
func_r54
func_param_l24
func_param_r54
---
test case"invalid function macros token"
in
expression'{{}.regsub("App([0-9]) ([a-z]+)","App\1")}'
out
return'FAIL'
---
test case"successfully found user macros token"
in
expression'{$MACRO:"A"}'
out
return SUCCEED
token_type ZBX_TOKEN_USER_MACRO
token_l0
token_r11
name_l2
name_r6
context_l8
context_r10
---
test case"invalid user macros token"
in
expression'{$:"A"}'
out
return'FAIL'
---
test case"LLD macro with function"