From e36217208802c001f1fbc758e5f103cbc4f339a2 Mon Sep 17 00:00:00 2001 From: Hannes Schulze Date: Sun, 3 Nov 2024 21:07:34 +0100 Subject: add unit tests for math --- src/services/quick-answer-service.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/services/quick-answer-service.c') diff --git a/src/services/quick-answer-service.c b/src/services/quick-answer-service.c index 8071998..670a72f 100644 --- a/src/services/quick-answer-service.c +++ b/src/services/quick-answer-service.c @@ -3,6 +3,12 @@ #include "launcher-item.h" #include +// +// FoobarQuickAnswer: +// +// A launcher item representing a quick, one-line answer to the query entered by the user. +// + struct _FoobarQuickAnswer { GObject parent_instance; @@ -48,6 +54,13 @@ G_DEFINE_FINAL_TYPE_WITH_CODE( G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE( FOOBAR_TYPE_LAUNCHER_ITEM, foobar_quick_answer_launcher_item_interface_init ) ) +// +// FoobarQuickAnswerService: +// +// Service providing quick answers for search queries in the launcher (if available). This includes evaluating +// mathematical expressions. +// + struct _FoobarQuickAnswerService { GObject parent_instance; @@ -324,7 +337,7 @@ FoobarQuickAnswer* foobar_quick_answer_service_query_math( gchar const* query ) FoobarMathExpression* expr = foobar_math_parse( tokens, token_count ); if ( expr ) { - foobar_math_expression_print( expr, 0 ); + // foobar_math_expression_print( expr, 0 ); FoobarMathValue val = { 0 }; if ( foobar_math_evaluate( expr, &val ) ) -- cgit v1.3.1