Skip to content

Put 'beforeProperty' breaks with indented properties. #89

Closed

Description

@nx-eric-jarosch

related to #68

    @Test
    void testPutBeforeIndentedProperty() throws IOException {
        final String given = "# header comment\n"
                + "\n"
                + "  # key comment\n"
                + "  key=val";
        final String expected = "# header comment\n"
                + "\n"
                + "put=putVal\n"
                + "  # key comment\n"
                + "  key=val";

        Properties p = Properties.loadProperties(new StringReader(given));
        p.put(p.beforeProperty("key"),"put", "putVal");
        expectStoreText(p, expected);
    }

results in

# header comment

  # key comment
put=putVal
  key=val
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions