From 9ee928be2c881bfac8d07f83545746cb9af07726 Mon Sep 17 00:00:00 2001 From: mtgto Date: Sun, 18 Aug 2024 20:01:58 +0900 Subject: [PATCH] =?UTF-8?q?JSON=E5=BD=A2=E5=BC=8F=E8=BE=9E=E6=9B=B8?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C=E3=81=A7=E3=83=86=E3=82=B9=E3=83=88=E3=81=8C?= =?UTF-8?q?=E9=80=9A=E3=81=A3=E3=81=A6=E3=81=AA=E3=81=84=E3=81=AE=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- macSKKTests/FileDictTests.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/macSKKTests/FileDictTests.swift b/macSKKTests/FileDictTests.swift index 1886c72..f34e5d3 100644 --- a/macSKKTests/FileDictTests.swift +++ b/macSKKTests/FileDictTests.swift @@ -70,7 +70,7 @@ final class FileDictTests: XCTestCase { func testSerialize() throws { let dict = try FileDict(contentsOf: fileURL, type: .traditional(.utf8), readonly: false) XCTAssertEqual(dict.serialize(), - [FileDict.headers[0], FileDict.okuriAriHeader, FileDict.okuriNashiHeader, ""].joined(separator: "\n").data(using: .utf8)) + [FileDict.headers[0], FileDict.okuriAriHeader, FileDict.okuriNashiHeader, ""].joined(separator: "\n")) dict.add(yomi: "あ", word: Word("亜", annotation: Annotation(dictId: "testDict", text: "亜の注釈"))) dict.add(yomi: "あ", word: Word("阿", annotation: Annotation(dictId: "testDict", text: "阿の注釈"))) dict.add(yomi: "あr", word: Word("有", annotation: Annotation(dictId: "testDict", text: "有の注釈"))) @@ -83,7 +83,7 @@ final class FileDictTests: XCTestCase { "あ /阿;阿の注釈/亜;亜の注釈/", "", ].joined(separator: "\n") - XCTAssertEqual(dict.serialize(), expected.data(using: .utf8)) + XCTAssertEqual(dict.serialize(), expected) // 追加したエントリはシリアライズ時は先頭に付く dict.add(yomi: "い", word: Word("伊")) dict.add(yomi: "いr", word: Word("射")) @@ -97,7 +97,7 @@ final class FileDictTests: XCTestCase { "あ /阿;阿の注釈/亜;亜の注釈/", "", ].joined(separator: "\n") - XCTAssertEqual(dict.serialize(), expected.data(using: .utf8)) + XCTAssertEqual(dict.serialize(), expected) // 追加更新した場合は順序を変更する。削除更新した場合は順序を変更しない XCTAssertTrue(dict.delete(yomi: "あ", word: "亜")) dict.add(yomi: "あr", word: Word("或")) @@ -110,6 +110,6 @@ final class FileDictTests: XCTestCase { "い /伊/", "", ].joined(separator: "\n") - XCTAssertEqual(dict.serialize(), expected.data(using: .utf8)) + XCTAssertEqual(dict.serialize(), expected) } }