Commit e65d5d0f authored by Kenton Varda's avatar Kenton Varda

Fix version test.

parent d68eaf1b
...@@ -37,9 +37,12 @@ TEST(Common, Version) { ...@@ -37,9 +37,12 @@ TEST(Common, Version) {
#ifdef VERSION #ifdef VERSION
auto expectedVersion = auto expectedVersion =
kj::str(CAPNP_VERSION_MAJOR, '.', CAPNP_VERSION_MINOR, '.', CAPNP_VERSION_MICRO); kj::str(CAPNP_VERSION_MAJOR, '.', CAPNP_VERSION_MINOR, '.', CAPNP_VERSION_MICRO);
auto devVersion =
kj::str(CAPNP_VERSION_MAJOR, '.', CAPNP_VERSION_MINOR, "-dev");
kj::StringPtr actualVersion = VERSION; kj::StringPtr actualVersion = VERSION;
KJ_ASSERT(actualVersion == expectedVersion || KJ_ASSERT(actualVersion == expectedVersion ||
actualVersion.startsWith(kj::str(expectedVersion, '-')), actualVersion.startsWith(kj::str(expectedVersion, '-')) ||
(actualVersion == devVersion && CAPNP_VERSION_MICRO == 0),
expectedVersion, actualVersion); expectedVersion, actualVersion);
#endif #endif
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment