A good way to test our newly created function is to continue after our first test and just save the result of parseConfigurationFile
.
So, here is the new test class:
class ComponentImpl { public static function main(): Void { var comp = ComponentParser.parseConfigurationFile("bin/conf.txt"); trace(comp.properties.get("text")); trace(comp.metadata.get("name")); //Test writing ComponentParser.writeConfigurationFile("bin/out.txt", comp); } }
After running this test, you should get a file with the following content:
nameMyComponent 1 textHelloWorld 0
As you saw, that was really simple.