If you look atRepositoryTestCase we flat out assert a very specific formatting for the entire file.  So for this we would say:

  String exp = "[testsection \"testsubsection\"]\n\ttestname=testvalue\n";
  assertEquals(exp, config.toText());