- Added token_reader::read_some(), which takes a view of a token buffer reads/unpacks up to that many tokens from a buffer. If an error occurs, or if there are fewer msgpack formats within the buffer, then the returned span will be a subspan of the original buffer. If no tokens were read before encountering an error, token_reader will return the error instead. - token::operator== overload for types that might be stored within the token. Handy for cleaning up tests, even though both methods of `token::get<T>() == value` and `token == value` are represented for now. - Added a simple tool to open a file containing msgpack content and read tokens into a buffer. This is for testing speed, but needs to be made into a proper benchmark once more work has been done. Pretty fast right now, only taking 2us to parse ~200 tokens (that takes the pythong msgpack implementation ~1s to handle).
57 lines
816 B
Python
57 lines
816 B
Python
|
|
cc_library(
|
|
name = "test_deps",
|
|
srcs = [
|
|
"test_main.cpp",
|
|
"rng.h"
|
|
],
|
|
deps = [
|
|
"//include/parselink:msgpack",
|
|
"@expected",
|
|
"@fmt",
|
|
"@magic_enum",
|
|
"@ut",
|
|
],
|
|
)
|
|
|
|
cc_test(
|
|
name = "reader",
|
|
srcs = [
|
|
"test_reader_relaxed.cpp",
|
|
"test_reader_strict.cpp",
|
|
],
|
|
deps = ["test_deps"],
|
|
)
|
|
|
|
cc_test(
|
|
name = "writer",
|
|
srcs = [
|
|
"test_writer.cpp",
|
|
],
|
|
deps = ["test_deps"],
|
|
)
|
|
|
|
cc_test(
|
|
name = "token",
|
|
srcs = [
|
|
"test_token.cpp",
|
|
],
|
|
deps = ["test_deps"],
|
|
)
|
|
|
|
cc_test(
|
|
name = "token_reader",
|
|
srcs = [
|
|
"test_token_reader.cpp",
|
|
],
|
|
deps = ["test_deps"],
|
|
)
|
|
|
|
cc_binary(
|
|
name = "speed",
|
|
srcs = [
|
|
"test_speed.cpp",
|
|
],
|
|
deps = ["test_deps"],
|
|
)
|