Skip to content
This repository
Browse code

test improvements, handler simplification with macro, some cleanup in…

… nu.nu
  • Loading branch information...
commit a22f3cf4140c8e41894893193ea8a1e1886240be 1 parent a6f3b50
Tim Burks authored
4 MacOS/Nu-framework/Nu.xcodeproj/project.pbxproj
@@ -69,6 +69,7 @@
69 69 2230622B13A54EDC00B67882 /* test_undo.nu in Resources */ = {isa = PBXBuildFile; fileRef = 223061FD13A54EDC00B67882 /* test_undo.nu */; };
70 70 2230622C13A54EDC00B67882 /* test_varargs.nu in Resources */ = {isa = PBXBuildFile; fileRef = 223061FE13A54EDC00B67882 /* test_varargs.nu */; };
71 71 224276FF11DD748600940005 /* Nu.h in Headers */ = {isa = PBXBuildFile; fileRef = 224276FE11DD748600940005 /* Nu.h */; };
  72 + 2256C21613AD134600830F69 /* handlers.m in Sources */ = {isa = PBXBuildFile; fileRef = 2256C21513AD134600830F69 /* handlers.m */; };
72 73 2276E5E013A5E4AB006A166B /* NuProperty.h in Headers */ = {isa = PBXBuildFile; fileRef = 2276E5DE13A5E4AB006A166B /* NuProperty.h */; };
73 74 2276E5E113A5E4AB006A166B /* NuProperty.m in Sources */ = {isa = PBXBuildFile; fileRef = 2276E5DF13A5E4AB006A166B /* NuProperty.m */; };
74 75 2276E5E213A5E4AB006A166B /* NuProperty.m in Sources */ = {isa = PBXBuildFile; fileRef = 2276E5DF13A5E4AB006A166B /* NuProperty.m */; };
@@ -251,6 +252,7 @@
251 252 223061FD13A54EDC00B67882 /* test_undo.nu */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = test_undo.nu; sourceTree = "<group>"; };
252 253 223061FE13A54EDC00B67882 /* test_varargs.nu */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = test_varargs.nu; sourceTree = "<group>"; };
253 254 224276FE11DD748600940005 /* Nu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Nu.h; sourceTree = "<group>"; };
  255 + 2256C21513AD134600830F69 /* handlers.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = handlers.m; path = ../../../util/handlers.m; sourceTree = "<group>"; };
254 256 2276E5DE13A5E4AB006A166B /* NuProperty.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NuProperty.h; sourceTree = "<group>"; };
255 257 2276E5DF13A5E4AB006A166B /* NuProperty.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NuProperty.m; sourceTree = "<group>"; };
256 258 228306F411DDBBD100A5C690 /* beautify.nu */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = beautify.nu; sourceTree = "<group>"; };
@@ -627,6 +629,7 @@
627 629 22EE2BFF13A4731600895861 /* NuApp */ = {
628 630 isa = PBXGroup;
629 631 children = (
  632 + 2256C21513AD134600830F69 /* handlers.m */,
630 633 22EE2C0813A4731600895861 /* NuAppDelegate.h */,
631 634 22EE2C0913A4731600895861 /* NuAppDelegate.m */,
632 635 22EE2C0013A4731600895861 /* Supporting Files */,
@@ -949,6 +952,7 @@
949 952 22EE2C6D13A4757B00895861 /* raw_api.c in Sources */,
950 953 22EE2C6F13A4757B00895861 /* types.c in Sources */,
951 954 2276E5E213A5E4AB006A166B /* NuProperty.m in Sources */,
  955 + 2256C21613AD134600830F69 /* handlers.m in Sources */,
952 956 );
953 957 runOnlyForDeploymentPostprocessing = 0;
954 958 };
21 MacOS/Nu-framework/Nu.xcodeproj/xcuserdata/tim.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist
... ... @@ -1,21 +0,0 @@
1   -<?xml version="1.0" encoding="UTF-8"?>
2   -<Bucket
3   - type = "1"
4   - version = "1.0">
5   - <FileBreakpoints>
6   - <FileBreakpoint
7   - shouldBeEnabled = "No"
8   - ignoreCount = "0"
9   - continueAfterRunningActions = "No"
10   - isPathRelative = "0"
11   - filePath = "/Volumes/Users/tim/Desktop/Repositories/nu/objc/NuClass.m"
12   - timestampString = "329806178.235263"
13   - startingColumnNumber = "9223372036854775807"
14   - endingColumnNumber = "9223372036854775807"
15   - startingLineNumber = "277"
16   - endingLineNumber = "277"
17   - landmarkName = "-propertyWithName:"
18   - landmarkType = "5">
19   - </FileBreakpoint>
20   - </FileBreakpoints>
21   -</Bucket>
6 MacOS/Nu-framework/NuApp/NuAppDelegate.m
@@ -56,9 +56,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
56 56 encoding:NSUTF8StringEncoding
57 57 error:NULL];
58 58 [[Nu sharedParser] parseEval:s];
59   -
60   - [[Nu sharedParser] parseEval:@"(global uname (do () \"iOS\"))"];
61   -
  59 +
62 60 NSString *resourceDirectory = [[NSBundle mainBundle] resourcePath];
63 61
64 62 NSArray *files = [[NSFileManager defaultManager]
@@ -78,7 +76,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
78 76 }
79 77 }
80 78 [regex release];
81   -
  79 + NSLog(@"running tests");
82 80 [[Nu sharedParser] parseEval:@"(NuTestCase runAllTests)"];
83 81 NSLog(@"ok");
84 82 return YES;
12 nu/match.nu
@@ -91,7 +91,7 @@
91 91 ;; Patterns like (head . tail) recurse.
92 92 ((and (pair? pat)
93 93 (pair? (pat cdr))
94   - (eq '. (second pat))
  94 + (eq '. (pat second))
95 95 (pair? ((pat cdr) cdr))
96 96 (eq nil (((pat cdr) cdr) cdr)))
97 97 (let ((bindings1 (destructure (pat 0) (seq 0)))
@@ -103,8 +103,8 @@
103 103 ((and (pair? pat)
104 104 (eq 'quote (pat 0))
105 105 (pair? (pat cdr))
106   - (symbol? (second pat)))
107   - (if (eq (second pat) seq)
  106 + (symbol? (pat second)))
  107 + (if (eq (pat second) seq)
108 108 (then '()) ; literal symbol match produces no bindings
109 109 (else (throw* "NuMatchException"
110 110 "Failed match of literal symbol #{pat} to #{seq}"))))
@@ -152,7 +152,7 @@
152 152 ;; Patterns like (head . tail)
153 153 ((and (pair? pat)
154 154 (pair? (cdr pat))
155   - (eq '. (second pat))
  155 + (eq '. (pat second))
156 156 (pair? (cdr (cdr pat)))
157 157 (eq nil (cdr (cdr (cdr pat)))))
158 158 ;(puts "mdest: (h . t): #{pat} #{seq}")
@@ -164,9 +164,9 @@
164 164 ((and (pair? pat)
165 165 (eq 'quote (car pat))
166 166 (pair? (cdr pat))
167   - (symbol? (second pat)))
  167 + (symbol? (pat second)))
168 168 ;(puts "mdest: 'Literal: #{pat} #{seq}")
169   - (if (eq (second pat) seq)
  169 + (if (eq (pat second) seq)
170 170 (then '()) ; literal symbol match produces no bindings
171 171 (else (throw* "NuMatchException"
172 172 "Failed match of literal symbol #{pat} to #{seq}"))))
31 nu/nu.nu
@@ -18,17 +18,6 @@
18 18 (global NSUTF8StringEncoding 4)
19 19 (global NSLog (NuBridgedFunction functionWithName:"NSLog" signature:"v@"))
20 20
21   -;; Warning! I want to deprecate these.
22   -(global second (do (my-list) (car (cdr my-list))))
23   -(global third (do (my-list) (car (cdr (cdr my-list)))))
24   -(global fourth (do (my-list) (car (cdr (cdr (cdr my-list))))))
25   -(global fifth (do (my-list) (car (cdr (cdr (cdr (cdr my-list)))))))
26   -(global sixth (do (my-list) (car (cdr (cdr (cdr (cdr (cdr my-list))))))))
27   -(global seventh (do (my-list) (car (cdr (cdr (cdr (cdr (cdr (cdr my-list)))))))))
28   -(global eighth (do (my-list) (car (cdr (cdr (cdr (cdr (cdr (cdr (cdr my-list))))))))))
29   -(global ninth (do (my-list) (car (cdr (cdr (cdr (cdr (cdr (cdr (cdr (cdr my-list)))))))))))
30   -(global tenth (do (my-list) (car (cdr (cdr (cdr (cdr (cdr (cdr (cdr (cdr (cdr my-list))))))))))))
31   -
32 21 (global rand
33 22 (do (maximum)
34 23 (let ((r (NuMath random)))
@@ -159,7 +148,7 @@
159 148 (else (do (a b) (a compare:b)))))
160 149 (((apply array ls) sortedArrayUsingBlock:block) list)))
161 150
162   -(if (eq (uname) "Darwin") ;; throw is currently only available with the Darwin runtime
  151 +(if (or (eq (uname) "Darwin") (eq (uname "iOS"))) ;; throw is currently only available with the Darwin runtime
163 152 (then
164 153 ;; Evaluates an expression and raises a NuAssertionFailure if the result is false.
165 154 ;; For example (assert (eq 1 1)) does nothing but (assert (eq (+ 1 1) 1)) throws
@@ -186,8 +175,6 @@
186 175 (global throw (macro-0 _ (NSLog "warning: throw is unavailable")))))
187 176
188 177
189   -
190   -
191 178 ;; Returns an array of filenames matching a given pattern.
192 179 ;; the pattern is a string that is converted into a regular expression.
193 180 (global filelist
@@ -221,22 +208,6 @@
221 208 (else (self appendString:object))))
222 209
223 210 (class NSObject
224   -
225   - ;; Write objects as XML property lists (only for NSData, NSString, NSNumber, NSDate, NSArray, and NSDictionary objects)
226   - (- writeToPropertyList:name is
227   - (set xmlData (NSPropertyListSerialization dataFromPropertyList:self
228   - format:100 ;; NSPropertyListXMLFormat_v1_0
229   - errorDescription:nil))
230   - (if xmlData (xmlData writeToFile:name atomically:YES)
231   - (else (puts ((error value) description)))))
232   -
233   - ;; Read objects from property lists
234   - (+ readFromPropertyList:name is
235   - (NSPropertyListSerialization propertyListFromData:(NSData dataWithContentsOfFile:name)
236   - mutabilityOption:0 ;; NSPropertyListImmutable
237   - format:nil
238   - errorDescription:nil))
239   -
240 211 (- XMLPropertyListRepresentation is
241 212 (NSPropertyListSerialization dataFromPropertyList:self
242 213 format:100 ;; NSPropertyListXMLFormat_v1_0
6 nu/test.nu
@@ -67,11 +67,11 @@
67 67 (((testClass alloc) init) run))))
68 68
69 69 (puts "")
70   - (puts "All: completed #{$tests} tests/#{$assertions} assertions/#{$failures} failures/#{$errors} errors")
  70 + (NSLog "All: completed #{$tests} tests/#{$assertions} assertions/#{$failures} failures/#{$errors} errors")
71 71 (puts "")
72 72 (if (or $failures $errors)
73   - (then (puts "FAILURE (#{$failures} failures, #{$errors} errors)"))
74   - (else (puts "SUCCESS (0 failures, 0 errors)")))
  73 + (then (NSLog "FAILURE (#{$failures} failures, #{$errors} errors)"))
  74 + (else (NSLog "SUCCESS (0 failures, 0 errors)")))
75 75 (+ $failures $errors))
76 76
77 77 ;; Run all the test cases for a particular instance of NuTestCase.
176 objc/NuHandler.m
@@ -137,122 +137,35 @@ static IMP handler_returning_void(void *userdata) {
137 137 });
138 138 }
139 139
140   -static IMP handler_returning_id(void *userdata) {
141   - return imp_implementationWithBlock(^(id receiver, ...) {
142   - struct handler_description description;
143   - description.handler = NULL;
144   - description.description = userdata;
145   - va_list ap;
146   - va_start(ap, receiver);
147   - id result;
148   - nu_handler(&result, &description, receiver, ap);
149   - return result;
150   - });
151   -}
152   -
153   -static IMP handler_returning_int(void *userdata) {
154   - return imp_implementationWithBlock(^(id receiver, ...) {
155   - struct handler_description description;
156   - description.handler = NULL;
157   - description.description = userdata;
158   - va_list ap;
159   - va_start(ap, receiver);
160   - int result;
161   - nu_handler(&result, &description, receiver, ap);
162   - return result;
163   - });
164   -}
165   -
166   -static IMP handler_returning_bool(void *userdata) {
167   - return imp_implementationWithBlock(^(id receiver, ...) {
168   - struct handler_description description;
169   - description.handler = NULL;
170   - description.description = userdata;
171   - va_list ap;
172   - va_start(ap, receiver);
173   - BOOL result;
174   - nu_handler(&result, &description, receiver, ap);
175   - return result;
176   - });
177   -}
178   -
179   -static IMP handler_returning_float(void *userdata) {
180   - return imp_implementationWithBlock(^(id receiver, ...) {
181   - struct handler_description description;
182   - description.handler = NULL;
183   - description.description = userdata;
184   - va_list ap;
185   - va_start(ap, receiver);
186   - float result;
187   - nu_handler(&result, &description, receiver, ap);
188   - return result;
189   - });
190   -}
191   -
192   -static IMP handler_returning_double(void *userdata) {
193   - return imp_implementationWithBlock(^(id receiver, ...) {
194   - struct handler_description description;
195   - description.handler = NULL;
196   - description.description = userdata;
197   - va_list ap;
198   - va_start(ap, receiver);
199   - double result;
200   - nu_handler(&result, &description, receiver, ap);
201   - return result;
202   - });
203   -}
204   -
205   -static IMP handler_returning_cgrect(void *userdata) {
206   - return imp_implementationWithBlock(^(id receiver, ...) {
207   - struct handler_description description;
208   - description.handler = NULL;
209   - description.description = userdata;
210   - va_list ap;
211   - va_start(ap, receiver);
212   - CGRect result;
213   - nu_handler(&result, &description, receiver, ap);
214   - return result;
215   - });
216   -}
217   -
218   -static IMP handler_returning_cgpoint(void *userdata) {
219   - return imp_implementationWithBlock(^(id receiver, ...) {
220   - struct handler_description description;
221   - description.handler = NULL;
222   - description.description = userdata;
223   - va_list ap;
224   - va_start(ap, receiver);
225   - CGPoint result;
226   - nu_handler(&result, &description, receiver, ap);
227   - return result;
228   - });
229   -}
230   -
231   -static IMP handler_returning_cgsize(void *userdata) {
232   - return imp_implementationWithBlock(^(id receiver, ...) {
233   - struct handler_description description;
234   - description.handler = NULL;
235   - description.description = userdata;
236   - va_list ap;
237   - va_start(ap, receiver);
238   - CGSize result;
239   - nu_handler(&result, &description, receiver, ap);
240   - return result;
241   - });
242   -}
243   -
244   -static IMP handler_returning_nsrange(void *userdata) {
245   - return imp_implementationWithBlock(^(id receiver, ...) {
246   - struct handler_description description;
247   - description.handler = NULL;
248   - description.description = userdata;
249   - va_list ap;
250   - va_start(ap, receiver);
251   - NSRange result;
252   - nu_handler(&result, &description, receiver, ap);
253   - return result;
254   - });
255   -}
  140 +#define MAKE_HANDLER_WITH_TYPE(type) \
  141 +static IMP handler_returning_ ## type (void* userdata) \
  142 +{ \
  143 + return imp_implementationWithBlock(^(id receiver, ...) { \
  144 + struct handler_description description; \
  145 + description.handler = NULL; \
  146 + description.description = userdata; \
  147 + va_list ap; \
  148 + va_start(ap, receiver); \
  149 + type result; \
  150 + nu_handler(&result, &description, receiver, ap); \
  151 + return result; \
  152 + }); \
  153 +}
  154 +
  155 +MAKE_HANDLER_WITH_TYPE(id)
  156 +MAKE_HANDLER_WITH_TYPE(int)
  157 +MAKE_HANDLER_WITH_TYPE(bool)
  158 +MAKE_HANDLER_WITH_TYPE(float)
  159 +MAKE_HANDLER_WITH_TYPE(double)
  160 +MAKE_HANDLER_WITH_TYPE(CGRect)
  161 +MAKE_HANDLER_WITH_TYPE(CGPoint)
  162 +MAKE_HANDLER_WITH_TYPE(CGSize)
  163 +#ifndef IPHONE
  164 +MAKE_HANDLER_WITH_TYPE(NSRect)
  165 +MAKE_HANDLER_WITH_TYPE(NSPoint)
  166 +MAKE_HANDLER_WITH_TYPE(NSSize)
  167 +#endif
  168 +MAKE_HANDLER_WITH_TYPE(NSRange)
256 169
257 170 static NSMutableDictionary *handlerWarehouse = nil;
258 171
@@ -289,17 +202,34 @@ + (IMP) handlerWithSelector:(SEL)sel block:(NuBlock *)block signature:(const cha
289 202 else if ([returnType isEqualToString:@"d"]) {
290 203 return handler_returning_double(userdata);
291 204 }
292   - else if ([returnType isEqualToString:@"{_CGRect={_CGPoint=ff}{_CGSize=ff}}"]) {
293   - return handler_returning_cgrect(userdata);
  205 + else if ([returnType isEqualToString:@"{CGRect={CGPoint=ff}{CGSize=ff}}"]) {
  206 + return handler_returning_CGRect(userdata);
294 207 }
295   - else if ([returnType isEqualToString:@"{_CGPoint=ff}"]) {
296   - return handler_returning_cgpoint(userdata);
  208 + else if ([returnType isEqualToString:@"{CGPoint=ff}"]) {
  209 + return handler_returning_CGPoint(userdata);
297 210 }
298   - else if ([returnType isEqualToString:@"{_CGSize=ff}"]) {
299   - return handler_returning_cgsize(userdata);
  211 + else if ([returnType isEqualToString:@"{CGSize=ff}"]) {
  212 + return handler_returning_CGSize(userdata);
300 213 }
301 214 else if ([returnType isEqualToString:@"{_NSRange=II}"]) {
302   - return handler_returning_nsrange(userdata);
  215 + return handler_returning_NSRange(userdata);
  216 + }
  217 +#ifndef IPHONE
  218 + else if ([returnType isEqualToString:@"{_NSRect={_NSPoint=dd}{_NSSize=dd}}"]) {
  219 + return handler_returning_NSRect(userdata);
  220 + }
  221 + else if ([returnType isEqualToString:@"{_NSPoint=dd}"]) {
  222 + return handler_returning_NSPoint(userdata);
  223 + }
  224 + else if ([returnType isEqualToString:@"{_NSSize=dd}"]) {
  225 + return handler_returning_NSSize(userdata);
  226 + }
  227 + else if ([returnType isEqualToString:@"{_NSRange=QQ}"]) {
  228 + return handler_returning_NSRange(userdata);
  229 + }
  230 +#endif
  231 + else {
  232 + NSLog(@"UNKNOWN RETURN TYPE %@", returnType);
303 233 }
304 234 // the following is deprecated. Now that we can create IMPs from blocks, we don't need handler pools.
305 235 if (!handlerWarehouse) {
4 objc/NuOperator.m
@@ -1891,7 +1891,11 @@ @interface Nu_uname_operator : NuOperator {}
1891 1891 @implementation Nu_uname_operator
1892 1892 - (id) callWithArguments:(id)cdr context:(NSMutableDictionary *)context
1893 1893 {
  1894 +#ifdef IPHONE
  1895 + return @"iOS";
  1896 +#else
1894 1897 return @"Darwin";
  1898 +#endif
1895 1899 }
1896 1900
1897 1901 @end
3  test/test_bridge.nu
@@ -5,11 +5,12 @@
5 5
6 6 (class TestBridge is NuTestCase
7 7 (- (id) testConstants is
  8 + (if (eq (uname) "Darwin")
8 9 (set floatTypeSignature (if (eq (Nu sizeOfPointer) 8) (then "d") (else "f")))
9 10 (assert_equal 0 (NuBridgedConstant constantWithName:"NSBlack" signature:floatTypeSignature))
10 11 (assert_equal 1 (NuBridgedConstant constantWithName:"NSWhite" signature:floatTypeSignature))
11 12 (assert_equal '(0 0 0 0) (NuBridgedConstant constantWithName:"NSZeroRect" signature:"{_NSRect}"))
12   - (assert_equal (NSApplication sharedApplication) (NuBridgedConstant constantWithName:"NSApp" signature:"@")))
  13 + (assert_equal (NSApplication sharedApplication) (NuBridgedConstant constantWithName:"NSApp" signature:"@"))))
13 14
14 15 (- (id) testFunctions is
15 16 (set strcmp (NuBridgedFunction functionWithName:"strcmp" signature:"i**"))
34 test/test_regex.nu
... ... @@ -1,7 +1,7 @@
1 1 ;; test_regex.nu
2 2 ;; tests for Nu regular expression support.
3 3 ;;
4   -;; Copyright (c) 2007 Tim Burks, Radtastical Inc.
  4 +;; Copyright (c) 2007,2011 Tim Burks, Radtastical Inc.
5 5
6 6 (class TestRegex is NuTestCase
7 7
@@ -10,27 +10,29 @@
10 10 (set match (r findInString:"abcdefghijklmnopqrstuvwxyz"))
11 11 (assert_equal 24 ((match groupAtIndex:1) length)))
12 12
13   - (if (eq (uname) "Darwin") ;; requires UTF-8
14   - (- (id) testScrapeWithOperator is
15   - (set s (NSString stringWithContentsOfFile:"test/test.html" encoding:NSUTF8StringEncoding error:nil))
16   - (set r (regex <<-END
  13 + (- (id) testScrapeWithOperator is
  14 + (set s (NSString stringWithContentsOfFile:((NSBundle mainBundle) pathForResource:"test" ofType:"html")))
  15 + (unless s
  16 + (set s (NSString stringWithContentsOfFile:"test/test.html" encoding:NSUTF8StringEncoding error:nil)))
  17 + (set r (regex <<-END
17 18 <a href="/search([^\"]*)"END))
18   - (set matches (r findAllInString:s))
19   - (assert_equal 10 (matches count))
20   - (assert_equal "?q=bicycle+pedal&amp;hl=en&amp;start=10&amp;sa=N" ((matches lastObject) groupAtIndex:1))))
  19 + (set matches (r findAllInString:s))
  20 + (assert_equal 10 (matches count))
  21 + (assert_equal "?q=bicycle+pedal&amp;hl=en&amp;start=10&amp;sa=N" ((matches lastObject) groupAtIndex:1)))
21 22
22 23 (- (id) testRegex is
23 24 (set match (/a(.*)z/ findInString:"abcdefghijklmnopqrstuvwxyz"))
24 25 (assert_equal 24 ((match groupAtIndex:1) length)))
25 26
26   - (if (eq (uname) "Darwin") ;; requires UTF-8
27   - (- (id) testRegexScraping is
28   - (set s (NSString stringWithContentsOfFile:"test/test.html" encoding:NSUTF8StringEncoding error:nil))
29   - (set r /<a href="\/search([^"]*)"/)
30   - (set matches (r findAllInString:s))
31   - (assert_equal 10 (matches count))
32   - (assert_equal "?q=bicycle+pedal&amp;hl=en&amp;start=10&amp;sa=N"
33   - ((matches lastObject) groupAtIndex:1))))
  27 + (- (id) testRegexScraping is
  28 + (set s (NSString stringWithContentsOfFile:((NSBundle mainBundle) pathForResource:"test" ofType:"html")))
  29 + (unless s
  30 + (set s (NSString stringWithContentsOfFile:"test/test.html" encoding:NSUTF8StringEncoding error:nil)))
  31 + (set r /<a href="\/search([^"]*)"/)
  32 + (set matches (r findAllInString:s))
  33 + (assert_equal 10 (matches count))
  34 + (assert_equal "?q=bicycle+pedal&amp;hl=en&amp;start=10&amp;sa=N"
  35 + ((matches lastObject) groupAtIndex:1)))
34 36
35 37 (- (id) testExtendedRegex is
36 38 (set r /foo # comment

0 comments on commit a22f3cf

Please sign in to comment.
Something went wrong with that request. Please try again.