core-lightning/common/test/run-version.c
Vincenzo Palazzo 8f94e8b943 comm: make sure that our version check is reliable
Rework the logic of the version check used in the
database migration, and make sure
that it is full functional to avoid confusion
at release time.

Changelog-Fixed: database: Correctly identity official release versions for database upgrade.

Reported-by: @urza
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2023-01-17 14:15:24 +10:30

17 lines
344 B
C

#include "config.h"
#include "../version.c"
#include <common/setup.h>
#include <assert.h>
#include <stdio.h>
int main(int argc, char *argv[])
{
common_setup(argv[0]);
assert(cmp_release_version("v22.11"));
assert(cmp_release_version("v22.11.1"));
assert(cmp_release_version("v22.11.1-6-gdf29990-modded") == false);
common_shutdown();
}