diff options
author | Mitya Selivanov <automainint@guattari.tech> | 2023-09-17 00:40:34 +0200 |
---|---|---|
committer | Mitya Selivanov <automainint@guattari.tech> | 2023-09-17 00:40:34 +0200 |
commit | 8499b75fb011d72eeb5acbd85bcf41e4ee51e9a7 (patch) | |
tree | a98f9a16b1deb05b949f44a13f9a30c97c812589 /source/tests/input_buffer.test.c | |
parent | 3f7f888e81cc8f34520bc23145422eadb0affad4 (diff) | |
download | kit-8499b75fb011d72eeb5acbd85bcf41e4ee51e9a7.zip |
XML
Diffstat (limited to 'source/tests/input_buffer.test.c')
-rw-r--r-- | source/tests/input_buffer.test.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/source/tests/input_buffer.test.c b/source/tests/input_buffer.test.c index 4712da9..237d60d 100644 --- a/source/tests/input_buffer.test.c +++ b/source/tests/input_buffer.test.c @@ -6,9 +6,9 @@ TEST("input buffer read once") { str_t text = { .size = 3, .values = "foo" }; is_handle_t in = IS_WRAP_STRING(text); - ib_handle_t first = IB_WRAP(in); + ib_t first = IB_WRAP(in); - ib_handle_t second = ib_read(first, 3); + ib_t second = ib_read(first, 3); REQUIRE(second.status == KIT_OK); REQUIRE(second.data.size == 3); @@ -23,10 +23,10 @@ TEST("input buffer read again") { str_t text = { .size = 6, .values = "foobar" }; str_t foo = { .size = 3, .values = "foo" }; is_handle_t in = IS_WRAP_STRING(text); - ib_handle_t first = IB_WRAP(in); + ib_t first = IB_WRAP(in); - ib_handle_t second = ib_read(first, 3); - ib_handle_t third = ib_read(first, 3); + ib_t second = ib_read(first, 3); + ib_t third = ib_read(first, 3); REQUIRE(AR_EQUAL(foo, second.data)); REQUIRE(AR_EQUAL(foo, third.data)); @@ -42,10 +42,10 @@ TEST("input buffer read twice") { str_t foo = { .size = 3, .values = "foo" }; str_t bar = { .size = 3, .values = "bar" }; is_handle_t in = IS_WRAP_STRING(text); - ib_handle_t first = IB_WRAP(in); + ib_t first = IB_WRAP(in); - ib_handle_t second = ib_read(first, 3); - ib_handle_t third = ib_read(second, 3); + ib_t second = ib_read(first, 3); + ib_t third = ib_read(second, 3); REQUIRE(AR_EQUAL(foo, second.data)); REQUIRE(AR_EQUAL(bar, third.data)); @@ -67,9 +67,9 @@ TEST("input buffer read integer once") { str_t text = { .size = 9, .values = "31415 foo" }; str_t num = { .size = 5, .values = "31415" }; is_handle_t in = IS_WRAP_STRING(text); - ib_handle_t first = IB_WRAP(in); + ib_t first = IB_WRAP(in); - ib_handle_t second = ib_read_while(first, is_integer_); + ib_t second = ib_while(first, is_integer_); REQUIRE(second.status == KIT_OK); REQUIRE(second.data.size == 5); @@ -85,11 +85,11 @@ TEST("input buffer read integer twice") { str_t num_0 = { .size = 3, .values = "314" }; str_t num_1 = { .size = 2, .values = "15" }; is_handle_t in = IS_WRAP_STRING(text); - ib_handle_t first = IB_WRAP(in); + ib_t first = IB_WRAP(in); - ib_handle_t second = ib_read_while(first, is_integer_); - ib_handle_t third = ib_read(second, 1); - ib_handle_t fourth = ib_read_while(third, is_integer_); + ib_t second = ib_while(first, is_integer_); + ib_t third = ib_read(second, 1); + ib_t fourth = ib_while(third, is_integer_); REQUIRE(fourth.status == KIT_OK); REQUIRE(second.data.size == 3); |