mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-28 06:47:53 +00:00
config: add tests for number suffix
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
This commit is contained in:
parent
52ca4f8a39
commit
53345e1f1f
BIN
tests/resources/config/config5
Normal file
BIN
tests/resources/config/config5
Normal file
Binary file not shown.
@ -129,10 +129,34 @@ int i;
|
||||
git_config_free(cfg);
|
||||
END_TEST
|
||||
|
||||
BEGIN_TEST(config5, "test number suffixes")
|
||||
git_config *cfg;
|
||||
const char *str;
|
||||
long int i;
|
||||
|
||||
must_pass(git_config_open(&cfg, CONFIG_BASE "/config5"));
|
||||
|
||||
must_pass(git_config_get_long(cfg, "number.simple", &i));
|
||||
must_be_true(i == 1);
|
||||
|
||||
must_pass(git_config_get_long(cfg, "number.k", &i));
|
||||
must_be_true(i == 1 * 1024);
|
||||
|
||||
must_pass(git_config_get_long(cfg, "number.m", &i));
|
||||
must_be_true(i == 1 * 1024 * 1024);
|
||||
|
||||
must_pass(git_config_get_long(cfg, "number.g", &i));
|
||||
must_be_true(i == 1 * 1024 * 1024 * 1024);
|
||||
|
||||
git_config_free(cfg);
|
||||
END_TEST
|
||||
|
||||
|
||||
BEGIN_SUITE(config)
|
||||
ADD_TEST(config0);
|
||||
ADD_TEST(config1);
|
||||
ADD_TEST(config2);
|
||||
ADD_TEST(config3);
|
||||
ADD_TEST(config4);
|
||||
ADD_TEST(config5);
|
||||
END_SUITE
|
||||
|
Loading…
Reference in New Issue
Block a user