aboutsummaryrefslogtreecommitdiff
path: root/test/src/TestArgs.c
diff options
context:
space:
mode:
authorMikhail Romanko <me@blankhex.com>2025-02-28 21:44:01 +0300
committerMikhail Romanko <me@blankhex.com>2025-02-28 21:44:22 +0300
commita2d0913c79880e2bf70539015686bab40108fb0d (patch)
tree9445732b7bb33f7691275605f72f44d8d7afbe01 /test/src/TestArgs.c
parent93033ebc99442038ab137710bbd4014a249e75c8 (diff)
downloadbhlib-a2d0913c79880e2bf70539015686bab40108fb0d.tar.gz
Add utils for working with endianness, more documentation, refactor CMake
Decided to update the docs, as well as adding few new features and small refactoring.
Diffstat (limited to 'test/src/TestArgs.c')
-rw-r--r--test/src/TestArgs.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/src/TestArgs.c b/test/src/TestArgs.c
index 4c2f6ae..940a9c6 100644
--- a/test/src/TestArgs.c
+++ b/test/src/TestArgs.c
@@ -385,6 +385,23 @@ BH_UNIT_TEST(InvalidLong)
}
+BH_UNIT_TEST(Aesthetics)
+{
+ BH_ArgsOption options[] = {
+ {'a', "abc", 0, NULL},
+ {'b', "bcd", BH_ARGS_VALUE, "B option"},
+ {'i', "input", BH_ARGS_VALUE | BH_ARGS_OPTIONAL, "Input option"},
+ {1000, "long-option", 0, "Long options\nWith newline"},
+ {'p', NULL, 0, "P option"},
+ {0, NULL, 0, NULL},
+ };
+
+ BH_ArgsHelp(options, 0);
+ return 0;
+}
+
+
+
int main(int argc, char **argv)
{
(void)argc;
@@ -398,6 +415,7 @@ int main(int argc, char **argv)
BH_UNIT_ADD(Complex);
BH_UNIT_ADD(InvalidShort);
BH_UNIT_ADD(InvalidLong);
+ BH_UNIT_ADD(Aesthetics);
return BH_UnitRun();
}