mirror of
https://github.com/zhigang1992/PerspectiveTransform.git
synced 2026-01-12 22:49:33 +08:00
add vector projection spec
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
4226E76D5782BCFD7E16A726 /* Pods_PerspectiveTransform_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 94A16A8706A6E84494068BCA /* Pods_PerspectiveTransform_Tests.framework */; };
|
||||
4BA3D17B1C771B2E0009B690 /* AdjugateSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BA3D17A1C771B2E0009B690 /* AdjugateSpec.swift */; };
|
||||
4BA3D17D1C771B560009B690 /* SpecHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BA3D17C1C771B560009B690 /* SpecHelper.swift */; };
|
||||
4BA3D1811C77230A0009B690 /* VectorProjectionSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BA3D1801C77230A0009B690 /* VectorProjectionSpec.swift */; };
|
||||
607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD51AFB9204008FA782 /* AppDelegate.swift */; };
|
||||
607FACD81AFB9204008FA782 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD71AFB9204008FA782 /* ViewController.swift */; };
|
||||
607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 607FACD91AFB9204008FA782 /* Main.storyboard */; };
|
||||
@@ -37,8 +38,9 @@
|
||||
4B3FE4F41C76F57000E6EB40 /* Quick.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Quick.framework; sourceTree = "<group>"; };
|
||||
4BA3D1781C77010D0009B690 /* Gemfile */ = {isa = PBXFileReference; lastKnownFileType = text; path = Gemfile; sourceTree = "<group>"; };
|
||||
4BA3D1791C77010D0009B690 /* Gemfile.lock */ = {isa = PBXFileReference; lastKnownFileType = text; path = Gemfile.lock; sourceTree = "<group>"; };
|
||||
4BA3D17A1C771B2E0009B690 /* AdjugateSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AdjugateSpec.swift; sourceTree = "<group>"; };
|
||||
4BA3D17A1C771B2E0009B690 /* AdjugateSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.swift; path = AdjugateSpec.swift; sourceTree = "<group>"; tabWidth = 4; };
|
||||
4BA3D17C1C771B560009B690 /* SpecHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SpecHelper.swift; sourceTree = "<group>"; };
|
||||
4BA3D1801C77230A0009B690 /* VectorProjectionSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VectorProjectionSpec.swift; sourceTree = "<group>"; };
|
||||
4EA2244D76A3BF4D89D92FD5 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; };
|
||||
54239BF346BDA1A204452D96 /* Pods_PerspectiveTransform_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_PerspectiveTransform_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
607FACD01AFB9204008FA782 /* PerspectiveTransform_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PerspectiveTransform_Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
@@ -137,6 +139,7 @@
|
||||
children = (
|
||||
607FACEB1AFB9204008FA782 /* MatrixSpec.swift */,
|
||||
4BA3D17A1C771B2E0009B690 /* AdjugateSpec.swift */,
|
||||
4BA3D1801C77230A0009B690 /* VectorProjectionSpec.swift */,
|
||||
607FACE91AFB9204008FA782 /* Supporting Files */,
|
||||
);
|
||||
path = Tests;
|
||||
@@ -383,6 +386,7 @@
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
4BA3D1811C77230A0009B690 /* VectorProjectionSpec.swift in Sources */,
|
||||
607FACEC1AFB9204008FA782 /* MatrixSpec.swift in Sources */,
|
||||
4BA3D17D1C771B560009B690 /* SpecHelper.swift in Sources */,
|
||||
4BA3D17B1C771B2E0009B690 /* AdjugateSpec.swift in Sources */,
|
||||
|
||||
17
Example/Tests/VectorProjectionSpec.swift
Normal file
17
Example/Tests/VectorProjectionSpec.swift
Normal file
@@ -0,0 +1,17 @@
|
||||
import Quick
|
||||
import Nimble
|
||||
import simd
|
||||
|
||||
class VectorProjectionSpec: QuickSpec {
|
||||
override func spec() {
|
||||
describe("vector projection") { () -> () in
|
||||
it("should be 0 orthogonally", closure: { () -> () in
|
||||
let v12 = vector_float2(1,0)
|
||||
let v23 = vector_float2(0,1)
|
||||
let p = project(v12, v23)
|
||||
expect(p.x) == 0
|
||||
expect(p.y) == 0
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user