Releases: ktown4u/ktown4u-utils
Releases · ktown4u/ktown4u-utils
v1.7.5
v1.7.4
v1.7.3
v1.7.2
v1.7.1
Diff in Markdown(v1.7.0)
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)
자잘한 버그 수정
Diff between strings(v1.6.0)
- 서로 다른 문자열을 전달하면 두 문자열의 차이를 반환한다
사용 예시
@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
- @JinuCheon made their first contribution in #6
- @hyemin916 made their first contribution in #11
Full Changelog: v1.5.1...1.6.0
ms 자리수를 6에서 2이상으로 변경
Merge pull request #9 from HMInternational/indented_line_formatter change last digit number 6 to gte 2
LineFormatter with depth(v1.5.0)
- 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