deps/ada-toml/tests/api/clone/main.adb
raw| 1 | with Ada.Text_IO; |
| 2 | |
| 3 | with TOML; |
| 4 | with TOML.File_IO; |
| 5 | |
| 6 | procedure Main is |
| 7 | Value : constant TOML.TOML_Value := |
| 8 | TOML.File_IO.Load_File ("example.toml").Value; |
| 9 | Clone : constant TOML.TOML_Value := Value.Clone; |
| 10 | begin |
| 11 | -- Mutate Value: the Clone is supposed to be unaffected |
| 12 | |
| 13 | Value.Set ("hello", TOML.Create_Boolean (true)); |
| 14 | Value.Get ("array").Append (TOML.Create_Boolean (false)); |
| 15 | |
| 16 | Ada.Text_IO.Put_Line (Clone.Dump_As_String); |
| 17 | end Main; |