From b207ccb565c5de37360660d790128fa5bbb858f1 Mon Sep 17 00:00:00 2001 From: xianjimli Date: Mon, 4 Feb 2019 18:04:19 +0800 Subject: [PATCH] format code --- src/ext_widgets/slide_menu/slide_menu.h | 2 +- tests/tokenizer_test.cc | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/ext_widgets/slide_menu/slide_menu.h b/src/ext_widgets/slide_menu/slide_menu.h index 5224c8f01..b9d437a3b 100644 --- a/src/ext_widgets/slide_menu/slide_menu.h +++ b/src/ext_widgets/slide_menu/slide_menu.h @@ -72,7 +72,7 @@ BEGIN_C_DECLS * ```c * widget_on(slide_menu, EVT_VALUE_CHANGED, on_current_changed, slide_menu); * ``` - + * * 可按下面的方法关注当前按钮被点击的事件: * * ```c diff --git a/tests/tokenizer_test.cc b/tests/tokenizer_test.cc index abe2161fd..b3ce15fde 100644 --- a/tests/tokenizer_test.cc +++ b/tests/tokenizer_test.cc @@ -78,3 +78,25 @@ TEST(Tokenizer, single_char_token) { tokenizer_deinit(t); } + +TEST(Tokenizer, until1) { + tokenizer_t tokenizer; + + tokenizer_t* t = tokenizer_init_ex(&tokenizer, "{a==1}", 100, "{ }", "=,"); + ASSERT_EQ(t, &tokenizer); + + ASSERT_EQ(string(tokenizer_next_until(t, ",}")), string("a==1")); + + tokenizer_deinit(t); +} + +TEST(Tokenizer, until2) { + tokenizer_t tokenizer; + + tokenizer_t* t = tokenizer_init_ex(&tokenizer, "{a==1, a}", 100, "{ }", "=,"); + ASSERT_EQ(t, &tokenizer); + + ASSERT_EQ(string(tokenizer_next_until(t, ",}")), string("a==1")); + + tokenizer_deinit(t); +}