It looks like garbled output… I didn't use shell-escape, because the other
characters that are special for the shell that are used in versions should
not be escaped.
if (argc == 3) {
r = strverscmp_improved(ASSERT_PTR(argv[1]), ASSERT_PTR(argv[2]));
printf("%s %s %s\n",
- argv[1],
+ isempty(argv[1]) ? "''" : argv[1],
r < 0 ? "<" : r > 0 ? ">" : "==",
- argv[2]);
+ isempty(argv[2]) ? "''" : argv[2]);
/* This matches the exit convention used by rpmdev-vercmp.
* We don't use named values because 11 and 12 don't have names. */
( ! $ANALYZE compare-versions 1 gt 2 )
( ! $ANALYZE compare-versions 1 '>' 2 )
-$ANALYZE compare-versions 1 2 | grep ' < '
-$ANALYZE compare-versions 2 2 | grep ' == '
-$ANALYZE compare-versions 2 1 | grep ' > '
+test "$($ANALYZE compare-versions 1 2)" = '1 < 2'
+test "$($ANALYZE compare-versions 2 2)" = '2 == 2'
+test "$($ANALYZE compare-versions 2 1)" = '2 > 1'
+test "$($ANALYZE compare-versions '' '')" = "'' == ''"
set +e