forked from alibaba/coobjc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(add load from contents of file): add load from contents of file …
…named add load from contents of file named
- Loading branch information
1 parent
c0da711
commit 05439bb
Showing
11 changed files
with
300 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,9 @@ | |
184C4DC221D3183800C94113 /* coKitURLConnectionTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 184C4DC121D3183800C94113 /* coKitURLConnectionTests.m */; }; | ||
184C4DC421D3184800C94113 /* coKitURLSession.m in Sources */ = {isa = PBXBuildFile; fileRef = 184C4DC321D3184800C94113 /* coKitURLSession.m */; }; | ||
184C4DC621D3185700C94113 /* coKitUserDefaults.m in Sources */ = {isa = PBXBuildFile; fileRef = 184C4DC521D3185700C94113 /* coKitUserDefaults.m */; }; | ||
1851C7142283FDA6008342C0 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 1851C7112283FDA6008342C0 /* [email protected] */; }; | ||
1851C7152283FDA6008342C0 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 1851C7122283FDA6008342C0 /* [email protected] */; }; | ||
1851C7162283FDA6008342C0 /* home.png in Resources */ = {isa = PBXBuildFile; fileRef = 1851C7132283FDA6008342C0 /* home.png */; }; | ||
18C43A3E21D1D4C300D75A9B /* DemoListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 18C43A3D21D1D4C300D75A9B /* DemoListViewController.m */; }; | ||
18C43A4221D1D4E500D75A9B /* AlertDemoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 18C43A4021D1D4E500D75A9B /* AlertDemoViewController.m */; }; | ||
18C43A4321D1D4E500D75A9B /* AlertDemoViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 18C43A4121D1D4E500D75A9B /* AlertDemoViewController.xib */; }; | ||
|
@@ -76,6 +79,9 @@ | |
184C4DC121D3183800C94113 /* coKitURLConnectionTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = coKitURLConnectionTests.m; sourceTree = "<group>"; }; | ||
184C4DC321D3184800C94113 /* coKitURLSession.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = coKitURLSession.m; sourceTree = "<group>"; }; | ||
184C4DC521D3185700C94113 /* coKitUserDefaults.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = coKitUserDefaults.m; sourceTree = "<group>"; }; | ||
1851C7112283FDA6008342C0 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; }; | ||
1851C7122283FDA6008342C0 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; }; | ||
1851C7132283FDA6008342C0 /* home.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = home.png; sourceTree = "<group>"; }; | ||
18C43A3C21D1D4C300D75A9B /* DemoListViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DemoListViewController.h; sourceTree = "<group>"; }; | ||
18C43A3D21D1D4C300D75A9B /* DemoListViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DemoListViewController.m; sourceTree = "<group>"; }; | ||
18C43A3F21D1D4E500D75A9B /* AlertDemoViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AlertDemoViewController.h; sourceTree = "<group>"; }; | ||
|
@@ -180,6 +186,9 @@ | |
183F72C421C9E9D10041C32B /* Resources */ = { | ||
isa = PBXGroup; | ||
children = ( | ||
1851C7132283FDA6008342C0 /* home.png */, | ||
1851C7122283FDA6008342C0 /* [email protected] */, | ||
1851C7112283FDA6008342C0 /* [email protected] */, | ||
183F72C521C9E9DE0041C32B /* test.json */, | ||
); | ||
path = Resources; | ||
|
@@ -217,8 +226,6 @@ | |
183F728A21C8E8890041C32B /* Sources */, | ||
183F728B21C8E8890041C32B /* Frameworks */, | ||
183F728C21C8E8890041C32B /* Resources */, | ||
24A92622A4331EE56ABFE7D5 /* [CP] Embed Pods Frameworks */, | ||
BF68B3A67305FACEED8A7FCA /* [CP] Copy Pods Resources */, | ||
); | ||
buildRules = ( | ||
); | ||
|
@@ -237,8 +244,6 @@ | |
183F72A221C8E88C0041C32B /* Sources */, | ||
183F72A321C8E88C0041C32B /* Frameworks */, | ||
183F72A421C8E88C0041C32B /* Resources */, | ||
CB2CC9A54B12823E5E21B0EB /* [CP] Embed Pods Frameworks */, | ||
866D6F23B88BC4316C965F2A /* [CP] Copy Pods Resources */, | ||
); | ||
buildRules = ( | ||
); | ||
|
@@ -294,8 +299,11 @@ | |
files = ( | ||
183F729E21C8E88B0041C32B /* LaunchScreen.storyboard in Resources */, | ||
18C43A4821D1D4F500D75A9B /* ImagePickerDemoViewController.xib in Resources */, | ||
1851C7162283FDA6008342C0 /* home.png in Resources */, | ||
183F72C621C9E9DE0041C32B /* test.json in Resources */, | ||
1851C7152283FDA6008342C0 /* [email protected] in Resources */, | ||
183F729B21C8E88B0041C32B /* Assets.xcassets in Resources */, | ||
1851C7142283FDA6008342C0 /* [email protected] in Resources */, | ||
183F729921C8E8890041C32B /* Main.storyboard in Resources */, | ||
18C43A4321D1D4E500D75A9B /* AlertDemoViewController.xib in Resources */, | ||
); | ||
|
@@ -317,28 +325,16 @@ | |
files = ( | ||
); | ||
inputPaths = ( | ||
"${PODS_PODFILE_DIR_PATH}/Podfile.lock", | ||
"${PODS_ROOT}/Manifest.lock", | ||
); | ||
name = "[CP] Check Pods Manifest.lock"; | ||
outputPaths = ( | ||
"$(DERIVED_FILE_DIR)/Pods-coKitExamplesTests-checkManifestLockResult.txt", | ||
); | ||
runOnlyForDeploymentPostprocessing = 0; | ||
shellPath = /bin/sh; | ||
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; | ||
showEnvVarsInLog = 0; | ||
}; | ||
24A92622A4331EE56ABFE7D5 /* [CP] Embed Pods Frameworks */ = { | ||
isa = PBXShellScriptBuildPhase; | ||
buildActionMask = 2147483647; | ||
files = ( | ||
); | ||
inputPaths = ( | ||
); | ||
name = "[CP] Embed Pods Frameworks"; | ||
outputPaths = ( | ||
); | ||
runOnlyForDeploymentPostprocessing = 0; | ||
shellPath = /bin/sh; | ||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-coKitExamples/Pods-coKitExamples-frameworks.sh\"\n"; | ||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; | ||
showEnvVarsInLog = 0; | ||
}; | ||
66A9FC6F6F04E954F19CFE67 /* [CP] Check Pods Manifest.lock */ = { | ||
|
@@ -347,58 +343,16 @@ | |
files = ( | ||
); | ||
inputPaths = ( | ||
"${PODS_PODFILE_DIR_PATH}/Podfile.lock", | ||
"${PODS_ROOT}/Manifest.lock", | ||
); | ||
name = "[CP] Check Pods Manifest.lock"; | ||
outputPaths = ( | ||
"$(DERIVED_FILE_DIR)/Pods-coKitExamples-checkManifestLockResult.txt", | ||
); | ||
runOnlyForDeploymentPostprocessing = 0; | ||
shellPath = /bin/sh; | ||
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; | ||
showEnvVarsInLog = 0; | ||
}; | ||
866D6F23B88BC4316C965F2A /* [CP] Copy Pods Resources */ = { | ||
isa = PBXShellScriptBuildPhase; | ||
buildActionMask = 2147483647; | ||
files = ( | ||
); | ||
inputPaths = ( | ||
); | ||
name = "[CP] Copy Pods Resources"; | ||
outputPaths = ( | ||
); | ||
runOnlyForDeploymentPostprocessing = 0; | ||
shellPath = /bin/sh; | ||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-coKitExamplesTests/Pods-coKitExamplesTests-resources.sh\"\n"; | ||
showEnvVarsInLog = 0; | ||
}; | ||
BF68B3A67305FACEED8A7FCA /* [CP] Copy Pods Resources */ = { | ||
isa = PBXShellScriptBuildPhase; | ||
buildActionMask = 2147483647; | ||
files = ( | ||
); | ||
inputPaths = ( | ||
); | ||
name = "[CP] Copy Pods Resources"; | ||
outputPaths = ( | ||
); | ||
runOnlyForDeploymentPostprocessing = 0; | ||
shellPath = /bin/sh; | ||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-coKitExamples/Pods-coKitExamples-resources.sh\"\n"; | ||
showEnvVarsInLog = 0; | ||
}; | ||
CB2CC9A54B12823E5E21B0EB /* [CP] Embed Pods Frameworks */ = { | ||
isa = PBXShellScriptBuildPhase; | ||
buildActionMask = 2147483647; | ||
files = ( | ||
); | ||
inputPaths = ( | ||
); | ||
name = "[CP] Embed Pods Frameworks"; | ||
outputPaths = ( | ||
); | ||
runOnlyForDeploymentPostprocessing = 0; | ||
shellPath = /bin/sh; | ||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-coKitExamplesTests/Pods-coKitExamplesTests-frameworks.sh\"\n"; | ||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; | ||
showEnvVarsInLog = 0; | ||
}; | ||
/* End PBXShellScriptBuildPhase section */ | ||
|
101 changes: 101 additions & 0 deletions
101
...mples/coKitExamples/coKitExamples.xcodeproj/xcshareddata/xcschemes/coKitExamples.xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Scheme | ||
LastUpgradeVersion = "1020" | ||
version = "1.3"> | ||
<BuildAction | ||
parallelizeBuildables = "YES" | ||
buildImplicitDependencies = "YES"> | ||
<BuildActionEntries> | ||
<BuildActionEntry | ||
buildForTesting = "YES" | ||
buildForRunning = "YES" | ||
buildForProfiling = "YES" | ||
buildForArchiving = "YES" | ||
buildForAnalyzing = "YES"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "183F728D21C8E8890041C32B" | ||
BuildableName = "coKitExamples.app" | ||
BlueprintName = "coKitExamples" | ||
ReferencedContainer = "container:coKitExamples.xcodeproj"> | ||
</BuildableReference> | ||
</BuildActionEntry> | ||
</BuildActionEntries> | ||
</BuildAction> | ||
<TestAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
shouldUseLaunchSchemeArgsEnv = "YES"> | ||
<Testables> | ||
<TestableReference | ||
skipped = "NO"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "183F72A521C8E88C0041C32B" | ||
BuildableName = "coKitExamplesTests.xctest" | ||
BlueprintName = "coKitExamplesTests" | ||
ReferencedContainer = "container:coKitExamples.xcodeproj"> | ||
</BuildableReference> | ||
</TestableReference> | ||
</Testables> | ||
<MacroExpansion> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "183F728D21C8E8890041C32B" | ||
BuildableName = "coKitExamples.app" | ||
BlueprintName = "coKitExamples" | ||
ReferencedContainer = "container:coKitExamples.xcodeproj"> | ||
</BuildableReference> | ||
</MacroExpansion> | ||
<AdditionalOptions> | ||
</AdditionalOptions> | ||
</TestAction> | ||
<LaunchAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
launchStyle = "0" | ||
useCustomWorkingDirectory = "NO" | ||
ignoresPersistentStateOnLaunch = "NO" | ||
debugDocumentVersioning = "YES" | ||
debugServiceExtension = "internal" | ||
allowLocationSimulation = "YES"> | ||
<BuildableProductRunnable | ||
runnableDebuggingMode = "0"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "183F728D21C8E8890041C32B" | ||
BuildableName = "coKitExamples.app" | ||
BlueprintName = "coKitExamples" | ||
ReferencedContainer = "container:coKitExamples.xcodeproj"> | ||
</BuildableReference> | ||
</BuildableProductRunnable> | ||
<AdditionalOptions> | ||
</AdditionalOptions> | ||
</LaunchAction> | ||
<ProfileAction | ||
buildConfiguration = "Release" | ||
shouldUseLaunchSchemeArgsEnv = "YES" | ||
savedToolIdentifier = "" | ||
useCustomWorkingDirectory = "NO" | ||
debugDocumentVersioning = "YES"> | ||
<BuildableProductRunnable | ||
runnableDebuggingMode = "0"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "183F728D21C8E8890041C32B" | ||
BuildableName = "coKitExamples.app" | ||
BlueprintName = "coKitExamples" | ||
ReferencedContainer = "container:coKitExamples.xcodeproj"> | ||
</BuildableReference> | ||
</BuildableProductRunnable> | ||
</ProfileAction> | ||
<AnalyzeAction | ||
buildConfiguration = "Debug"> | ||
</AnalyzeAction> | ||
<ArchiveAction | ||
buildConfiguration = "Release" | ||
revealArchiveInOrganizer = "YES"> | ||
</ArchiveAction> | ||
</Scheme> |
56 changes: 56 additions & 0 deletions
56
.../coKitExamples/coKitExamples.xcodeproj/xcshareddata/xcschemes/coKitExamplesTests.xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Scheme | ||
LastUpgradeVersion = "1020" | ||
version = "1.3"> | ||
<BuildAction | ||
parallelizeBuildables = "YES" | ||
buildImplicitDependencies = "YES"> | ||
</BuildAction> | ||
<TestAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
shouldUseLaunchSchemeArgsEnv = "YES"> | ||
<Testables> | ||
<TestableReference | ||
skipped = "NO"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "183F72A521C8E88C0041C32B" | ||
BuildableName = "coKitExamplesTests.xctest" | ||
BlueprintName = "coKitExamplesTests" | ||
ReferencedContainer = "container:coKitExamples.xcodeproj"> | ||
</BuildableReference> | ||
</TestableReference> | ||
</Testables> | ||
<AdditionalOptions> | ||
</AdditionalOptions> | ||
</TestAction> | ||
<LaunchAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
launchStyle = "0" | ||
useCustomWorkingDirectory = "NO" | ||
ignoresPersistentStateOnLaunch = "NO" | ||
debugDocumentVersioning = "YES" | ||
debugServiceExtension = "internal" | ||
allowLocationSimulation = "YES"> | ||
<AdditionalOptions> | ||
</AdditionalOptions> | ||
</LaunchAction> | ||
<ProfileAction | ||
buildConfiguration = "Release" | ||
shouldUseLaunchSchemeArgsEnv = "YES" | ||
savedToolIdentifier = "" | ||
useCustomWorkingDirectory = "NO" | ||
debugDocumentVersioning = "YES"> | ||
</ProfileAction> | ||
<AnalyzeAction | ||
buildConfiguration = "Debug"> | ||
</AnalyzeAction> | ||
<ArchiveAction | ||
buildConfiguration = "Release" | ||
revealArchiveInOrganizer = "YES"> | ||
</ArchiveAction> | ||
</Scheme> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.15 KB
cokit/Examples/coKitExamples/coKitExamples/Resources/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.8 KB
cokit/Examples/coKitExamples/coKitExamples/Resources/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,8 @@ | |
// limitations under the License. | ||
|
||
#import <XCTest/XCTest.h> | ||
#import <coobjc/coobjc.h> | ||
#import <cokit/UIImage+Coroutine.h> | ||
|
||
@interface coKitExamplesTests : XCTestCase | ||
|
||
|
@@ -37,6 +39,38 @@ - (void)tearDown { | |
- (void)testExample { | ||
// This is an example of a functional test case. | ||
// Use XCTAssert and related functions to verify your tests produce the correct results. | ||
XCTestExpectation *e = [self expectationWithDescription:@"test"]; | ||
co_launch(^{ | ||
UIImage *image = await([UIImage async_imageWithContentsOfFileNamed:@"home"]); | ||
NSAssert(image != nil, @"test"); | ||
|
||
image = await([UIImage async_imageWithContentsOfFileNamed:@"home1"]); | ||
NSAssert(image != nil, @"test1"); | ||
|
||
image = await([UIImage async_imageWithContentsOfFileNamed:@"home2"]); | ||
NSAssert(image != nil, @"test2"); | ||
|
||
image = await([UIImage async_imageWithContentsOfFileNamed:@"home.png"]); | ||
NSAssert(image != nil, @"test"); | ||
|
||
image = await([UIImage async_imageWithContentsOfFileNamed:@"home1.png"]); | ||
NSAssert(image != nil, @"test1"); | ||
|
||
image = await([UIImage async_imageWithContentsOfFileNamed:@"home2.png"]); | ||
NSAssert(image != nil, @"test2"); | ||
|
||
image = await([UIImage async_imageWithContentsOfFileNamed:@"[email protected]"]); | ||
NSAssert(image == nil, @"test"); | ||
|
||
image = await([UIImage async_imageWithContentsOfFileNamed:@"[email protected]"]); | ||
NSAssert(image == nil, @"test1"); | ||
|
||
image = await([UIImage async_imageWithContentsOfFileNamed:@"[email protected]"]); | ||
NSAssert(image == nil, @"test2"); | ||
[e fulfill]; | ||
}); | ||
|
||
[self waitForExpectations:@[e] timeout:10]; | ||
} | ||
|
||
- (void)testPerformanceExample { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.