Skip to content

Releases: ktown4u/ktown4u-utils

v1.7.5

31 Jul 07:50
Compare
Choose a tag to compare
update build.gradle.kts to work with java1.8

v1.7.4

31 Jul 07:17
Compare
Choose a tag to compare
change switch statements to work with java1.8

v1.7.3

30 Jul 13:47
Compare
Choose a tag to compare
rename method

v1.7.2

30 Jul 13:37
6b45e1a
Compare
Choose a tag to compare
Merge pull request #13 from ktown4u/update-markdown

Markdown 문자열 비교를 객체 비교로 변경

v1.7.1

29 Jul 00:46
Compare
Choose a tag to compare
update build.gradle.kts

Diff in Markdown(v1.7.0)

29 Jul 00:27
Compare
Choose a tag to compare

Diff in Markdown(v1.7.0)
서로 다른 문자열을 전달하면 approval test를 통해 두 문자열의 차이를 볼 수 있는 .md 파일을 자동 생성한다.

    @Test
    @DisplayName("두 문자열을 비교한다")
    void git_diff() {
        final String before = before();
        final String after = after();

        Approvals.verify(
                Markdown.title("두 문자열을 비교한다.")
                        .description("두 문자열을 비교하여 markdown diff 포맷으로 차이를 확인한다.")
                        .diff(before, after));
    }

What's Changed

  • feature - diff를 markdown으로 볼 수 있는 기능 추가 by @hyemin916 in #12

Full Changelog: v.1.6.1...v1.7.0

Diff between strings(v1.6.1)

26 Jul 06:27
Compare
Choose a tag to compare

자잘한 버그 수정

Diff between strings(v1.6.0)

25 Jul 06:13
40f79ed
Compare
Choose a tag to compare
  • 서로 다른 문자열을 전달하면 두 문자열의 차이를 반환한다

사용 예시

@Test
void diff() {
  final String before = """
          totalPrice: 0
          totalDiscountPrice: 0
          mileageToBeEarned: 0
          """;
  final String after = """
          totalPrice: 100
          totalDiscountPrice: 10
          """;

  Approvals.verify(Diff.between(before, after));
}

approved.text

+ totalPrice: 0 -> 100
+ totalDiscountPrice: 0 -> 10
-- mileageToBeEarned: 0

+: 수정된 라인
++: 추가된 라인
--: 삭제된 라인

What's Changed

  • Feature/ 원하는 필드만 포함하는 printWithInclusions method 추가 by @JinuCheon in #6
  • [B] feature - 문자열을 비교하는 유틸 추가 by @hyemin916 in #11

New Contributors

Full Changelog: v1.5.1...1.6.0

ms 자리수를 6에서 2이상으로 변경

25 Apr 02:56
17d9dc2
Compare
Choose a tag to compare
Merge pull request #9 from HMInternational/indented_line_formatter

change last digit number 6 to gte 2

LineFormatter with depth(v1.5.0)

30 Mar 02:49
e105273
Compare
Choose a tag to compare
  • depth를 인자를 전달하면 depth만큼의 indentation 공백을 추가한 문자열을 반환한다
@Test
void multiple_lines_with_depth() {
  LineFormatter lineFormatter = new LineFormatter(80);
  List<IndentiedLine> lines = List.of(
          new IndentiedLine(1, "key1", "value1"),
          new IndentiedLine(1, "key2", "value2"),
          new IndentiedLine(2, "key11", "value1"),
          new IndentiedLine(2, "key12", "value2")
  );
  String formattedLine = lineFormatter.formatLineWithWhitespaces("key", null);
  for (IndentiedLine line : lines) {
    formattedLine += lineFormatter.formatLineWithWhitespaces(line.depth, line.name, line.value);
  }
  Approvals.verify(formattedLine);
}

record IndentiedLine(int depth, String name, String value) {
}
  • 이와 같이 호출하면 아래와 같은 결과를 얻을 수 있음
key                                                                         null
    key1                                                                  value1
    key2                                                                  value2
        key11                                                             value1
        key12                                                             value2