PengZheng commented on issue #685:
URL: https://github.com/apache/celix/issues/685#issuecomment-1848399679

   I found the white space at the start of a value is not escaped correctly by 
our implementation.
   The following modified test case will fail on `keyA` (note the value is " 
valueA" rather than "valueA"):
   
   ```C++
   TEST_F(PropertiesTestSuite, StoreTest) {
       const char* propertiesFile = "resources-test/properties_out.txt";
       celix_autoptr(celix_properties_t) properties = celix_properties_create();
       celix_properties_set(properties, "keyA", " valueA");
       celix_properties_set(properties, "keyB", "valueB");
       celix_properties_store(properties, propertiesFile, nullptr);
   
       celix_autoptr(celix_properties_t) properties2 = 
celix_properties_load(propertiesFile);
       EXPECT_EQ(celix_properties_size(properties), 
celix_properties_size(properties2));
       EXPECT_STREQ(celix_properties_get(properties, "keyA", ""), 
celix_properties_get(properties2, "keyA", ""));
       EXPECT_STREQ(celix_properties_get(properties, "keyB", ""), 
celix_properties_get(properties2, "keyB", ""));
   }
   ```
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@celix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to