@@ -82,6 +82,8 @@ TEST(RteItemTest, ComponentAttributesFromId) {
8282 RteItem item (" component" , nullptr );
8383 item.SetAttributesFomComponentId (id);
8484 EXPECT_EQ (id, item.GetComponentID (true ));
85+ EXPECT_EQ (item.GetAttribute (" explicitVersion" ), " @9.9.9" );
86+ EXPECT_TRUE (item.GetAttributeAsBool (" explicitVendor" ));
8587
8688 id =
" Class&Bundle:Group:Sub&[email protected] " ;
8789 item.SetAttributesFomComponentId (id);
@@ -98,6 +100,18 @@ TEST(RteItemTest, ComponentAttributesFromId) {
98100 id = " Class:Group:&Variant" ;
99101 item.SetAttributesFomComponentId (id);
100102 EXPECT_EQ (" Class:Group&Variant" , item.GetComponentID (true ));
103+
104+ id = " Group:Sub" ;
105+ item.SetAttributesFomComponentId (id);
106+ EXPECT_EQ (id, item.GetComponentID (true ));
107+ EXPECT_TRUE (item.GetAttribute (" explicitVersion" ).empty ());
108+ EXPECT_FALSE (item.GetAttributeAsBool (" explicitVendor" ));
109+
110+ id = " Group:Sub@^9.0.0" ;
111+ item.SetAttributesFomComponentId (id);
112+ EXPECT_EQ (id, item.GetComponentID (true ));
113+ EXPECT_EQ (item.GetAttribute (" explicitVersion" )," @^9.0.0" );
114+ EXPECT_EQ (item.GetVersionString ()," ^9.0.0" );
101115}
102116
103117TEST (RteItemTest, SemVer) {
0 commit comments