 |
Changeset 5693
- Timestamp:
- 01/26/12 10:21:41
(3 weeks ago)
- Author:
- Marenz
- Message:
fixing unittests, fixes #2103, thanks to SiegeLord?
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r5688 |
r5693 |
|
| 3529 | 3529 | unittest |
|---|
| 3530 | 3530 | { |
|---|
| 3531 | | auto arr = map((int i) { return i * 2L; }, [1, 17, 8, 12]); |
|---|
| | 3531 | auto arr = map([1, 17, 8, 12], (int i) { return i * 2L; }); |
|---|
| 3532 | 3532 | assert(arr == [2L, 34L, 16L, 24L]); |
|---|
| 3533 | 3533 | } |
|---|
| … | … | |
| 3582 | 3582 | unittest |
|---|
| 3583 | 3583 | { |
|---|
| 3584 | | auto result = reduce((int i, int j) { return i * j; }, [1, 17, 8, 12]); |
|---|
| | 3584 | auto result = reduce([1, 17, 8, 12], (int i, int j) { return i * j; }); |
|---|
| 3585 | 3585 | assert(result == 1632); |
|---|
| 3586 | 3586 | } |
|---|
| … | … | |
| 3657 | 3657 | rpos++; |
|---|
| 3658 | 3658 | } |
|---|
| 3659 | | assert( rpos == num ); |
|---|
| 3660 | 3659 | } |
|---|
| | 3660 | assert( rpos == num ); |
|---|
| 3661 | 3661 | } |
|---|
| 3662 | 3662 | |
|---|
| 3663 | | test( "abcdefghij".dup, ( char c ) { return c == 'x'; }, 10 ); |
|---|
| 3664 | | test( "xabcdefghi".dup, ( char c ) { return c == 'x'; }, 9 ); |
|---|
| 3665 | | test( "abcdefghix".dup, ( char c ) { return c == 'x'; }, 9 ); |
|---|
| 3666 | | test( "abxxcdefgh".dup, ( char c ) { return c == 'x'; }, 8 ); |
|---|
| | 3663 | test( "abcdefghij".dup, ( char c ) { return c == 'x'; }, 0 ); |
|---|
| | 3664 | test( "xabcdefghi".dup, ( char c ) { return c == 'x'; }, 1 ); |
|---|
| | 3665 | test( "abcdefghix".dup, ( char c ) { return c == 'x'; }, 1 ); |
|---|
| | 3666 | test( "abxxcdefgh".dup, ( char c ) { return c == 'x'; }, 2 ); |
|---|
| 3667 | 3667 | test( "xaxbcdxxex".dup, ( char c ) { return c == 'x'; }, 5 ); |
|---|
| 3668 | 3668 | } |
|---|
Download in other formats:
|
 |
 |
|
 |
Copyright © 2006-2012 Tango. All Rights Reserved. | Page Width:
Static or
Dynamic