From 9dc06d01c2224ee1dbeb11ebee7c8afecfac8b05 Mon Sep 17 00:00:00 2001 From: hachem Date: Mon, 31 Aug 2026 23:14:26 +0200 Subject: feat: add support for floats through xmm registers --- tests/lexer_test.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests/lexer_test.c') diff --git a/tests/lexer_test.c b/tests/lexer_test.c index 38644d9..a44b1f0 100644 --- a/tests/lexer_test.c +++ b/tests/lexer_test.c @@ -28,6 +28,14 @@ static void test_number_bases(struct TestContext* context) check(context, token_matches(scan_token(&lexer), TOKEN_INTEGER, "0b1010")); } +static void test_float_literals(struct TestContext* context) +{ + struct Lexer lexer = create_lexer("3.14 1.0 42"); + check(context, token_matches(scan_token(&lexer), TOKEN_FLOAT, "3.14")); + check(context, token_matches(scan_token(&lexer), TOKEN_FLOAT, "1.0")); + check(context, scan_token(&lexer).type == TOKEN_INTEGER); +} + static void test_operators(struct TestContext* context) { struct Lexer lexer = create_lexer("= == += != /"); @@ -92,6 +100,7 @@ void run_lexer_tests(struct TestContext* context) { test_identifiers_and_integers(context); test_number_bases(context); + test_float_literals(context); test_operators(context); test_literals(context); test_keywords(context); -- cgit v1.3