Brian Anderson
44aebb978c
Add tests for unsafe::reinterpret_cast
2011-11-18 10:32:27 -08:00
Brian Anderson
a9f7cbe240
stdlib: Add tests for sys::size_of and sys::align_of
2011-11-18 10:32:27 -08:00
Marijn Haverbeke
f6491bb426
Update stdlib, compiler, and tests to new kind system
...
This involved adding 'copy' to more generics than I hoped, but an
experiment with making it implicit showed that that way lies madness --
unless enforced, you will not remember to mark functions that don't
copy as not requiring copyable kind.
Issue #1177
2011-11-18 12:49:01 +01:00
Niko Matsakis
adc79e2f44
remove compile-command from local variable blocks
2011-11-17 11:46:13 -08:00
Niko Matsakis
25bc37cef9
refactor all unix types
2011-11-16 15:24:08 -08:00
Brian Anderson
f157d0b32c
Fix S_IRUSR/S_IWUSR constants on mac. Closes #726
2011-11-16 12:18:15 -08:00
Stefan Plantikow
d335d1a169
Replaced constant functions with actual constants in std and updated tests
...
Fixes issue #1165
2011-11-15 18:02:45 -08:00
Elly Jones
24b6645156
str: add escape()
...
Signed-off-by: Elly Jones <elly@leptoquark.net>
2011-11-10 19:53:28 -08:00
Haitao Li
7ee8b852fd
Cleanup unused imports in tests
2011-11-10 19:19:40 -08:00
Brian Anderson
0f1af17a60
Remove all uses of native cdecl except for those that yield
2011-11-08 11:29:10 -08:00
Elly Jones
656a2af989
json: betterify for brson
...
Signed-off-by: Elly Jones <ellyjones@google.com>
2011-11-07 15:44:43 -08:00
David Rajchenbach-Teller
7bfe4dba80
[Test] rope.rs: testing concat
2011-11-06 18:10:23 +01:00
David Rajchenbach-Teller
f9a0d03c7a
Fixup: forgotten stdtest/rope.rs
2011-11-05 13:04:34 -07:00
David Rajchenbach-Teller
a5dcf66ad3
stdlib: Added a small rope library
2011-11-05 13:04:34 -07:00
David Rajchenbach-Teller
07ffe68ad9
uint.rs: added functions div_ceil, div_floor, div_round
2011-11-05 13:04:34 -07:00
Matt Brubeck
5970e9c117
Add vec::permute to the standard library ( #1013 )
2011-11-02 15:35:10 -07:00
Marijn Haverbeke
d8d35e7c40
Rename car/cdr to head/tail in std::list
...
Closes #1086
2011-11-02 14:23:49 +01:00
Marijn Haverbeke
0a20eed2db
Make ptr::addr_of return an immutable vec, add mut_addr_of
2011-11-02 12:20:12 +01:00
Brian Anderson
35affdfa61
Ignore another test involving failure on windows
2011-11-01 17:35:32 -07:00
Brian Anderson
eb8995e2fa
Ignore should_fail tests on windows
2011-11-01 17:22:32 -07:00
Matt Brubeck
76077a9fb7
Add should_fail annotation for unit tests
...
This allows test cases to assert that a function is expected to fail.
Tests annotated with "should_fail" will succeed only if the function
fails.
2011-11-01 16:55:39 -07:00
Brian Anderson
8207506bbc
Fix the filenames used in some IO tests
...
These tests are relying on not being able to open certain files, but did not
work correctly when run as root.
2011-10-31 12:50:45 -07:00
Matt Brubeck
80c926c5e2
Add a char::to_digit function
2011-10-31 16:15:36 +01:00
Matt Brubeck
4739942e74
Correct handling of non-numeric chars in parse_buf
...
Without this fix, int::parse_buf and uint::parse_buf return incorrect results
for any strings that contain non-numeric characters. Fixes #1102 .
2011-10-31 16:15:32 +01:00
Marijn Haverbeke
6f37accb29
Rename std::str::chars to iter_chars
2011-10-31 15:41:52 +01:00
Marijn Haverbeke
b0d60a7108
Add a way to iterate over a str's chars to std::str
2011-10-31 14:52:08 +01:00
Matt Brubeck
7080ac15fb
Fix int::parse_buf for negative numbers ( #1102 )
2011-10-30 13:40:59 -07:00
Matt Brubeck
8c51d4b002
Make float::from_str ignore whitespace ( #1089 )
...
Discard leading and trailing whitespace, for consistency with C/JS/Java/etc.
Also, don't allow floating point numbers that start or end with 'e'.
2011-10-30 13:40:59 -07:00
Brian Anderson
ce1be4d9a9
Cleanup the existing platform-specific ignored tests
2011-10-29 18:30:36 -07:00
Brian Anderson
2e0593d999
stdlib: Add vec::concat to concatenate a vector of vectors
...
Compare to str::concat
2011-10-29 18:14:08 -07:00
Brian Anderson
2cebef095e
stdlib: Make io failures recoverable by returning a result
2011-10-29 01:25:11 -07:00
Brian Anderson
2b62a80202
stdlib: Add result::chain for composing results
2011-10-29 01:25:11 -07:00
Brian Anderson
802deac323
stdlib: Add fs::splitext
...
Splits a path into the filename + extension
2011-10-28 23:34:01 -07:00
Brian Anderson
a2377ccf91
stdlib: Add vec::init. Returns all but the last element.
...
Per haskell, to go with head/tail, and last.
2011-10-28 22:42:38 -07:00
Matt Brubeck
45d7777991
Change behavior of float::nonpositive/nonnegative
...
Rather than being defined as !positive and !negative, these should act the
same as negative and positive (respectively). The only effect of this change
should be that all four functions will now return false for NaN.
2011-10-28 14:44:39 -07:00
Matt Brubeck
000b2fe9a6
Use IEEE 754 semantics for NaN (Issue #1084 )
2011-10-28 14:44:39 -07:00
Matt Brubeck
7e064deacf
+0.0 should be positive and -0.0 should be negative.
2011-10-28 14:44:39 -07:00
Brian Anderson
ad66d72e6c
stdlib: Make merge_sort take [mutable? T]
2011-10-28 13:56:01 -07:00
Brian Anderson
39b729e36f
stdlib: Fix the list::foldl implementation
2011-10-28 13:45:32 -07:00
Brian Anderson
49e8ffa34f
stdlib: Rename list::length to list::len to match vec::len
2011-10-28 13:37:19 -07:00
Brian Anderson
d53a253dca
stdlib: make list::from_vec take [mutable? T]
2011-10-28 13:24:39 -07:00
Marijn Haverbeke
3397fa4701
Move to short kind kinds words in test suite
...
Issue #1076
2011-10-28 14:57:49 +02:00
Brian Anderson
4bb5a2c43a
Remove whitespace
2011-10-27 21:35:08 -07:00
Brian Anderson
d96c419b14
Add std::vec::foldr
2011-10-27 21:34:16 -07:00
Brian Anderson
8ad857f453
Add a test for std::vec::iter2
2011-10-27 21:17:51 -07:00
Brian Anderson
7a7940daca
Add reverse iterators to std::vec
2011-10-27 21:09:02 -07:00
Brian Anderson
1a89e589a4
Implement vec::foldl without recursion
2011-10-27 20:47:06 -07:00
Brian Anderson
b5ed1c46c0
Add std::vec::iter
2011-10-27 20:30:06 -07:00
Brian Anderson
91997e79aa
Make vec::reversed take [mutable? T]
2011-10-27 17:49:13 -07:00
Marijn Haverbeke
013107a25c
Properly take mutable object fields into account during alias analysis
...
Closes #1055
2011-10-25 17:57:26 +02:00