Added properties round trip test

This commit is contained in:
Mike Farah
2022-02-09 13:31:51 +11:00
parent a5ab9a8a0a
commit e0d6b45651
6 changed files with 100 additions and 6 deletions
+25
View File
@@ -119,3 +119,28 @@ person:
- pizza
```
## Roundtrip
Given a sample.properties file of:
```properties
# comments on values appear
person.name = Mike
# comments on array values appear
person.pets.0 = cat
person.food.0 = pizza
```
then
```bash
yq -p=props -o=props '.person.pets.0 = "dog"' sample.properties
```
will output
```properties
# comments on values appear
person.name = Mike
# comments on array values appear
person.pets.0 = dog
person.food.0 = pizza
```