Merge branch 'rs/mailinfo-header-cmp' into maint
[gitweb.git] / t / t7004-tag.sh
index c8d6e9f88cc36f7e6a1208721ea6c45991452b9e..143a8ea60507a35bbdfb310eb74a33cf5b88bf1f 100755 (executable)
@@ -1380,4 +1380,47 @@ test_expect_success 'multiple --points-at are OR-ed together' '
        test_cmp expect actual
 '
 
+test_expect_success 'lexical sort' '
+       git tag foo1.3 &&
+       git tag foo1.6 &&
+       git tag foo1.10 &&
+       git tag -l --sort=refname "foo*" >actual &&
+       cat >expect <<EOF &&
+foo1.10
+foo1.3
+foo1.6
+EOF
+       test_cmp expect actual
+'
+
+test_expect_success 'version sort' '
+       git tag -l --sort=version:refname "foo*" >actual &&
+       cat >expect <<EOF &&
+foo1.3
+foo1.6
+foo1.10
+EOF
+       test_cmp expect actual
+'
+
+test_expect_success 'reverse version sort' '
+       git tag -l --sort=-version:refname "foo*" >actual &&
+       cat >expect <<EOF &&
+foo1.10
+foo1.6
+foo1.3
+EOF
+       test_cmp expect actual
+'
+
+test_expect_success 'reverse lexical sort' '
+       git tag -l --sort=-refname "foo*" >actual &&
+       cat >expect <<EOF &&
+foo1.6
+foo1.3
+foo1.10
+EOF
+       test_cmp expect actual
+'
+
 test_done