-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathNormal.swift
More file actions
51 lines (37 loc) · 1.63 KB
/
Normal.swift
File metadata and controls
51 lines (37 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//=----------------------------------------------------------------------------=
// This source file is part of the DiffableTextViews open source project.
//
// Copyright (c) 2022 Oscar Byström Ericsson
// Licensed under Apache License, Version 2.0
//
// See http://www.apache.org/licenses/LICENSE-2.0 for license information.
//=----------------------------------------------------------------------------=
#if DEBUG
@testable import DiffableTextKit
import XCTest
//*============================================================================*
// MARK: * Normal x Tests
//*============================================================================*
final class NormalTextStyleTests: XCTestCase {
//=------------------------------------------------------------------------=
// MARK: State
//=------------------------------------------------------------------------=
let normal = NormalTextStyle()
//=------------------------------------------------------------------------=
// MARK: Tests
//=------------------------------------------------------------------------=
func testFormat() {
XCTAssertEqual(normal.format("2"), "2")
}
func testInterpret() {
XCTAssertEqual(normal.interpret("3"), Commit("3", "3"))
}
func testResolve() {
let snapshot = Snapshot("13") + Snapshot("o(><)o", as: .phantom)
let proposal = Proposal(snapshot, with: "2", in: C(1) ..< C(1))
let resolved = try! normal.resolve(proposal)
XCTAssertEqual(resolved.value, "123")
XCTAssertEqual(resolved.snapshot, "123")
}
}
#endif