-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
57 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/** | ||
* test-regression.c | ||
* | ||
* Copyright (c) 2012 | ||
* libchewing Core Team. See ChangeLog for details. | ||
* | ||
* See the file "COPYING" for information on usage and redistribution | ||
* of this file. | ||
*/ | ||
|
||
#ifdef HAVE_CONFIG_H | ||
#include <config.h> | ||
#endif | ||
|
||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
#include "chewing.h" | ||
#include "plat_types.h" | ||
#include "hash-private.h" | ||
#include "test.h" | ||
|
||
|
||
void test_libchewing_data_issue_1() | ||
{ | ||
const TestData DATA = { | ||
.token = "e03y.3", | ||
.expected = "趕走", | ||
}; | ||
ChewingContext *ctx; | ||
|
||
remove( TEST_HASH_DIR PLAT_SEPARATOR HASH_FILE ); | ||
|
||
chewing_Init( NULL, NULL ); | ||
|
||
ctx = chewing_new(); | ||
chewing_set_maxChiSymbolLen( ctx, 16 ); | ||
type_keystoke_by_string( ctx, DATA.token ); | ||
ok_preedit_buffer( ctx, DATA.expected ); | ||
|
||
chewing_delete( ctx ); | ||
chewing_Terminate(); | ||
} | ||
|
||
int main() | ||
{ | ||
putenv( "CHEWING_PATH=" CHEWING_DATA_PREFIX ); | ||
putenv( "CHEWING_USER_PATH=" TEST_HASH_DIR ); | ||
|
||
test_libchewing_data_issue_1(); | ||
|
||
return exit_status(); | ||
} |