Skip to content

Commit

Permalink
test: update word2number test
Browse files Browse the repository at this point in the history
  • Loading branch information
molingyu committed Sep 4, 2024
1 parent 2ce4c49 commit dba7ab6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ set_target_properties(test PROPERTIES
C_EXTENSIONS NO
)

target_link_libraries(test PRIVATE i18n_format)

# Special access to i18n-format internals for testing
target_include_directories(test PRIVATE ${CMAKE_SOURCE_DIR}/src)

Expand Down
6 changes: 5 additions & 1 deletion test/test_word2number.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,13 @@

#include "test_macros.h"

#include "../src/word2number.h"
#include "gen/word2number.h"

int Word2NumberTest( void ) {
const int num = word2number("一", "zh_CN");
printf("%d\n", num);

const char* word = number2word(2, "zh_CN");
printf("%s\n", word);
return 0;
}

0 comments on commit dba7ab6

Please sign in to comment.