diff -r bb7cff720dd0 -r 3df9258cd3cc src/server/test/object.c --- a/src/server/test/object.c Sat Nov 12 11:01:11 2022 +0100 +++ b/src/server/test/object.c Sat Nov 12 11:52:47 2022 +0100 @@ -57,6 +57,28 @@ pool_destroy(pool); } +UCX_TEST(test_expr_parse_expr_neg_value) { + pool_handle_t *pool = pool_create(); + + CxList *tokens = cxLinkedListCreate(pool_allocator(pool), cx_cmp_ptr, sizeof(cxstring)); + cxstring token = cx_str("-123"); + cxListAdd(tokens, &token); + + UCX_TEST_BEGIN; + + size_t pos = 0; + NSAPIExpression *expr = expr_parse_logical_expr(pool, tokens, &pos); + + UCX_TEST_ASSERT(pos == 1, "wrong token pos"); + UCX_TEST_ASSERT(expr, "expression is null"); + UCX_TEST_ASSERT(expr->type == NSAPI_EXPRESSION_INT, "wrong type"); + UCX_TEST_ASSERT(expr->value.i == -123, "wrong value"); + + UCX_TEST_END; + + pool_destroy(pool); +} + UCX_TEST(test_expr_parse_expr_value_str) { pool_handle_t *pool = pool_create();