-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathMoveToTests.swift
53 lines (44 loc) · 1.43 KB
/
MoveToTests.swift
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
52
53
//
// MoveToTests.swift
// SVGPath
//
// Created by Tim Wood on 1/22/15.
// Copyright (c) 2015 Tim Wood. All rights reserved.
//
import XCTest
import SVGPath
class MoveToTests: XCTestCase {
func testSingleMoveTo() {
let actual:[SVGCommand] = SVGPath("M1 2").commands
let expect:[SVGCommand] = [
SVGCommand(1.0, 2.0, type: .move)
]
assertCommandsEqual(actual, expect)
}
func testMultipleMoveToSameCommand() {
let actual:[SVGCommand] = SVGPath("M1 2 3 4").commands
let expect:[SVGCommand] = [
SVGCommand(1.0, 2.0, type: .move),
SVGCommand(3.0, 4.0, type: .move)
]
assertCommandsEqual(actual, expect)
}
func testMultipleMoveToNewCommands() {
let actual:[SVGCommand] = SVGPath("M1 2M3 4").commands
let expect:[SVGCommand] = [
SVGCommand(1.0, 2.0, type: .move),
SVGCommand(3.0, 4.0, type: .move)
]
assertCommandsEqual(actual, expect)
}
func testMultipleMoveToRelative() {
let actual:[SVGCommand] = SVGPath("M1 2m1 2m5 6 1 1").commands
let expect:[SVGCommand] = [
SVGCommand(1.0, 2.0, type: .move),
SVGCommand(2.0, 4.0, type: .move),
SVGCommand(7.0, 10.0, type: .move),
SVGCommand(8.0, 11.0, type: .move)
]
assertCommandsEqual(actual, expect)
}
}