libxbps: require an underscore in strings to detect correctly pkgname/version.

This commit is contained in:
Juan RP
2012-06-05 10:58:39 +02:00
parent 9441f9f14b
commit c37026d4c6
11 changed files with 159 additions and 130 deletions

View File

@@ -33,8 +33,8 @@ array_init(void)
a = prop_array_create();
ATF_REQUIRE(a != NULL);
prop_array_add_cstring_nocopy(a, "foo-2.0");
prop_array_add_cstring_nocopy(a, "blah-2.1");
prop_array_add_cstring_nocopy(a, "foo-2.0_1");
prop_array_add_cstring_nocopy(a, "blah-2.1_1");
return a;
}
@@ -48,8 +48,8 @@ ATF_TC_HEAD(match_string_test, tc)
ATF_TC_BODY(match_string_test, tc)
{
prop_array_t a = array_init();
ATF_REQUIRE_EQ(xbps_match_string_in_array(a, "foo-2.0"), true);
ATF_REQUIRE_EQ(xbps_match_string_in_array(a, "foo-2.1"), false);
ATF_REQUIRE_EQ(xbps_match_string_in_array(a, "foo-2.0_1"), true);
ATF_REQUIRE_EQ(xbps_match_string_in_array(a, "foo-2.1_1"), false);
}
ATF_TC(match_pkgname_test);
@@ -87,7 +87,7 @@ ATF_TC_HEAD(match_pkgdep_test, tc)
ATF_TC_BODY(match_pkgdep_test, tc)
{
prop_array_t a = array_init();
ATF_REQUIRE_EQ(xbps_match_pkgdep_in_array(a, "foo-2.0"), true);
ATF_REQUIRE_EQ(xbps_match_pkgdep_in_array(a, "foo-2.0_1"), true);
}
ATF_TP_ADD_TCS(tp)