forked from onevcat/VVDocumenter-Xcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVVTestHelper.m
More file actions
executable file
·98 lines (76 loc) · 4.45 KB
/
VVTestHelper.m
File metadata and controls
executable file
·98 lines (76 loc) · 4.45 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
//
// VVTestHelper.m
// VVDocumenter-Xcode
//
// Created by 王 巍 on 13-7-19.
// Copyright (c) 2013年 OneV's Den. All rights reserved.
//
#import "VVTestHelper.h"
@implementation VVTestHelper
+(NSArray *) testCodes
{
NSArray *methods = @[@"+ (ADTransition *)nullTransition;",
@" - (BOOL) application: (UIApplication *) application \n didFinishLaunchingWithOptions: (NSDictionary *) launchOptions;",
@"- (id)initWithDuration:(CFTimeInterval)duration sourceRect:(CGRect)sourceRect {"];
NSArray *functions = @[@"void dosomething ( int x, int y );",
@"int main(int argc, char *argv[]) \n {",
@"void NoParamFunc();",
@"typeof void(^IBLShareSuccessBlock)(ShareType type, SSPublishContentState state, id<ISSStatusInfo> statusInfo, BOOL end);"];
NSArray *properties = @[@"@property (nonatomic, copy ) NSString *code;",
@" @property ( nonatomic, strong ) Miao* test;",
@"@property ( assign, strong ) int test;"];
NSArray *macros = @[@"#define MAX(A,B) ({",
@"#define MIN(A,B) ((A) < (B) ? (A) : (B))",
@"#define ABS(A) ((A) < 0 ? (-(A)) : (A))"];
NSArray *structs = @[@"struct Foo \n {",
@" struct node {",
@"struct objc_object {"];
NSArray *enums = @[@"typedef NS_ENUM {",
@"typedef NS_ENUM \n {",
@" typedef NS_ENUM{"];
NSArray *unions = @[@"union {",
@" union \n {",
@" union{"];
NSArray *others = @[@"options = options | NSRegularExpressionDotMatchesLineSeparators;",
@"if (resultUntilSemiColon && resultUntilBrace) {",
@"static dispatch_once_t once;"];
NSArray *compileKeywords = @[@"@interface VVDocumenter : NSObject \n {",
@"@interface SyntaxTests()\n@property (nonatomic, retain) NSArray* inputs;",
@"@implementation SyntaxTests\n\n- (void)setUp\n{",
@"@interface A (a)\n- (id) foo;"];
return @[methods,functions,properties,macros,structs,enums,unions,others,compileKeywords];
}
+(NSArray *) uniformCodes
{
NSArray *methods = @[@"+(ADTransition *)nullTransition;",
@" -(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions;",
@"-(id)initWithDuration:(CFTimeInterval)duration sourceRect:(CGRect)sourceRect {"];
NSArray *functions = @[@"void dosomething( int x, int y );",
@"int main(int argc, char *argv[]){",
@"void NoParamFunc();",
@"typeof void(^IBLShareSuccessBlock)(ShareType type, SSPublishContentState state, id<ISSStatusInfo> statusInfo, BOOL end);"];
NSArray *properties = @[@"@property(nonatomic, copy )NSString *code;",
@" @property( nonatomic, strong )Miao* test;",
@"@property( assign, strong )int test;"];
NSArray *macros = @[@"#define MAX(A,B)({",
@"#define MIN(A,B)((A)<(B)?(A):(B))",
@"#define ABS(A)((A)< 0 ?(-(A)) :(A))"];
NSArray *structs = @[@"struct Foo {",
@" struct node {",
@"struct objc_object {"];
NSArray *enums = @[@"typedef NS_ENUM {",
@"typedef NS_ENUM {",
@" typedef NS_ENUM{"];
NSArray *unions = @[@"union {",
@" union {",
@" union{"];
NSArray *others = @[@"options = options | NSRegularExpressionDotMatchesLineSeparators;",
@"if(resultUntilSemiColon && resultUntilBrace){",
@"static dispatch_once_t once;"];
NSArray *compileKeywords = @[@"@interface VVDocumenter : NSObject {",
@"@interface SyntaxTests()@property(nonatomic, retain)NSArray* inputs;",
@"@implementation SyntaxTests -(void)setUp {",
@"@interface A(a)-(id)foo;"];
return @[methods,functions,properties,macros,structs,enums,unions,others,compileKeywords];
}
@end