Commit Graph
487 Commits
Author SHA1 Message Date
daboe01andGitHub 17136d23f9 NEW: for..of iterator for CPDictionary (#3113) 2025-09-25 07:27:17 +02:00
daboe01 c14e08633d fixed: testcase 2025-09-02 15:51:40 +03:00
daboe01 dfbf07b10c fixed: test suite 2025-09-02 15:44:39 +03:00
daboe01 b2b29c928f fixed: testcases 2025-09-02 15:41:34 +03:00
daboe01 799cb189c9 new: test cases 2025-09-02 15:28:14 +03:00
daboe01andGitHub c41307dc37 Merge branch 'main' into fixed-CPTimeZone-initWithName-does-not-return-the-timeZone-with-the-good-daylight-saving- 2025-07-05 12:58:01 +02:00
daboe01andGitHub 0e8ee2f7d5 Merge pull request #3130 from daboe01/fixed-NSDateFormatter-unable-to-parse-dates-in-Javascript-Date.toISOString-format
fixed: NSDateFormatter was unable to parse dates in Javascript Date.toISOString format
2025-07-01 16:21:30 +02:00
daboe01 b6461ba4fb fixed: tests 2025-06-29 20:28:43 +02:00
daboe01 25708554fd fixed: typo 2025-06-29 20:22:38 +02:00
daboe01 74f204e6fa fixed: tests and implementation 2025-06-29 20:20:58 +02:00
daboe01 263ec36d80 fixed: test 2025-06-29 19:42:12 +02:00
daboe01 bb6b738fc7 fixed: CPTimeZone initWithName: does not return the timeZone with the good daylight saving 2025-06-29 19:34:56 +02:00
daboe01 fb1c2732ac fixed test 2025-06-29 18:00:19 +02:00
daboe01 1fb42fc119 fixed: NSDateFormatter was unable to parse dates in Javascript Date.toISOString format 2025-06-29 17:51:08 +02:00
daboe01 feb8ea0316 new: test case for the new timezone abbreviation logic 2025-06-22 19:33:13 +02:00
daboe01andGitHub 85f7125f22 New: for..of iteration for CPSet (#3114) 2025-06-18 10:22:41 +02:00
Martin CarlbergandGitHub 86d595b086 Fixed: Make the isa property on classes not enumerable. (#3100)
As we have a tool-free bridges between many classes and JavaScript types by setting the isa property on the type, for example CPArray and Array. Using the for...in enumeration the isa property will be included in the loop if the property is enumerable (this is the default behavior). This commit set the property as not enumerable.

Also added test case for check that the isa property on classes are not enumerable using a for...in loop.
2025-05-14 10:09:01 +02:00
Martin Carlberg 9e6f1e0dc3 Fixed: Timezone abbreviation was not working with the latest changes on all setups.
This is still not 100% but looks like it works a little bit better
2021-09-21 15:38:51 +02:00
Martin Carlberg 9f14dac5d2 Fixed: Cleanup of the output from our test cases 2021-09-21 11:11:25 +02:00
Martin Carlberg 6b1cdbd19c Fixed: Removed compiler warnings from test cases 2021-09-21 10:58:03 +02:00
Martin Carlberg 6c49116c68 Fixed: Use date string that is not as old as the previous one.
JavaScript now handles time a lot better. Times from before around 1900 is different in different
parts of the world so we just changed this test case to be a bit more modern.
2021-09-21 10:55:16 +02:00
Martin Carlberg 68f0cf27df Fixed: Bundle test cases must run asynchronous as a bundle will also load asynchronous in Node.
Also removed some compilation warnings from the test cases.
2021-09-21 10:51:17 +02:00
Martin Carlberg 24bf09b70c Fixed: Abbreviation for a timezone is not handled in JavaScript. This changes makes it better but not perfect. 2021-09-21 10:30:26 +02:00
Martin Carlberg a835202db1 Fixed: Adjusted test cases for Node. XMLHttpRequest now demands a protocol. 2021-09-20 11:00:37 +02:00
Martin Carlberg a893f3f5c1 Fixed: The tool ojtest now works with the new Node version. 2021-09-03 14:31:11 +02:00
daboe01 9c95c9c6e9 formatting 2020-07-13 20:37:52 +02:00
daboe01 4b052e74f1 test whether range restriction works 2020-07-05 16:06:04 +02:00
daboe01 bd6b8e4b7f fixed: comparison between wrong objects 2020-07-03 21:27:48 +02:00
daboe01 26e8432bb0 debugging 2020-07-03 19:55:51 +02:00
daboe01 05f9fd22fe formatting 2020-07-03 19:36:06 +02:00
daboe01 8f5bde2797 new: unittest for replaceOccurrencesOfString:withString:options:range: 2020-07-02 19:38:34 +02:00
Martin Carlberg f5937a6fad Fixed: CPComparisonPredicate does never evaluate to true for a predicate like 'something != nil'
An example:

var array = @[ @{@"Name": @"1"},
               @{@"Name": @"2", @"approveTime": @"Now"}
             ];

var predicate = [CPPredicate predicateWithFormat:@"approveTime != nil"];

CPLog(@"result: %@", [array filteredArrayUsingPredicate:predicate]); // result: <empty array>

If I run this in Cappuccino I get an empty array

If I run it in Cocoa on a Mac I get:

result: (
        {
        Name = 2;
        approveTime = Now;
    }
2020-01-31 14:24:29 +01:00
Martin Carlberg dad49354aa Fixed: CPSet enumerateObjectsUsingBlock: will honor the stop variable
Test case also added.

Deprecated the very old behaviour that the block could return YES to abort the enumeration.
2019-10-18 13:01:04 +02:00
daboe01andMartin Carlberg 7bd8bf02f6 Fixed: Typo in function call to _CPDecimalSetZero and made the test case work properly (#2820) 2019-06-13 16:09:17 +02:00
cacaodev 5da8728d6c New: CPObject instancesImplementSelector:(SEL)aSelector
Tests if instances of given class implement a selector.

With test.

Note: The naming is from cocoa where this method is semi-public.
2016-11-12 18:30:02 +01:00
Martin Carlbergandcacaodev ae5d31746e Dependent key paths use a relationship (#2431)
Fixed: When dependent key paths use a relationship, only the first added observer will observe the attribute for the relationship object.

Also, an optimisation on when the willChange… chain is running, there is no need to replace the observers as no new values are set yet. That will be done when the didChange… chain is running.
2016-05-09 22:14:20 +02:00
Alexander Ljungberg e13f5ed730 Fixed: CPNumber intValue did not return an integer.
We expect this method to return a whole number like in Objective-C. This also goes for the related methods, `shortValue`, `longValue` and `longLongValue`.

Also adds more tests (in addition to the existing, already failing test).
2016-04-01 22:22:03 +01:00
Martin Carlberg c1ec27045c Fixed: Rhino does not support numbers starting with ’0’ 2016-03-23 09:35:19 +01:00
Martin Carlberg 111b12161c Added: test cases for ’intValue’ and ’integerValue’ methods on CPString and CPNumber 2016-03-23 09:02:09 +01:00
cacaodev 6b683bd02d Merge pull request #2402 from cacaodev/CPExpression-constructors
NEW : CPExpression +expressionForBlock:arguments:
                                   +expressionForConditional:trueExpression:falseExpression:
2016-01-25 10:22:18 +01:00
cacaodev e172217427 Merge pull request #2404 from cacaodev/CPArray-mapUsingBlock
New: CPArray -arrayByApplyingBlock:
2016-01-16 19:25:07 +01:00
Antoine Mercadal 5d88d07edc FIXED: CPPredicate's predicateFormat with a CPNull value as right expression wasn't working
Previously a CPPredicate created with format `value == nil` was converted back to `value == <CPNull @ xxxx>`

This patch ensures `predicateFormat` returns `value == nil`

Test added in CPPredicateTest.j
2016-01-14 15:50:24 -08:00
cacaodev 08aa591c65 NEW CPArray -arrayByApplyingBlock:(Function/*element, index*/)aBlock
Test for CPArray -arrayByApplyingBlock:
2016-01-14 21:57:57 +01:00
cacaodev 07b6e2b9f1 CPExpression +expressionForConditional:trueExpression:falseExpression:
Conditional Expression : an expression using different expressions for
evaluation, depending of a predicate result.

Support for predicate parsing: ```TERNARY(predicate, trueExpression,
falseExpression)```

With init, equal, evaluation, parsing tests.
2015-12-27 15:45:03 +01:00
cacaodev 5ab10f4024 NEW: CPExpression +expressionForBlock:arguments:
An expression that returns the result of evaluating a block.

With tests.
2015-12-27 15:44:36 +01:00
cacaodev 0ac08456bc Merge pull request #2401 from cacaodev/CPSubqueryExpression
FIXED: Subquery expressions were ignoring evaluation context
2015-12-26 00:12:13 +01:00
cacaodev 80a3549ef5 FIXED: Subquery expressions were ignoring evaluation context
When the predicate part of a subquery expression was containing
variables, the substitution was ignored.
Now, the subpredicate can contain variables that will be substituted
when calling evaluateWithObject:substitutionVariables:.

Added expression test and predicate parsing test.
2015-12-23 18:49:07 +01:00
Alexandre Wilhelm b59b0259ca Fixed: CPDateFormatter did not work with symbols MM and LL with the month of december 2015-12-09 10:51:51 -08:00
Martin Carlberg 758ad3eb06 Fixed: Method types was not copied into new KVO implementation of a class that is observed with KVO.
Some test cases are also added for this.
2015-11-20 12:43:53 +01:00
Antoine Mercadal d5f38fe2f2 Merge pull request #2392 from Dogild/RunLoopBlock
New: added the method performBlock in CPRunLoop
2015-10-27 17:36:22 -07:00