Commit graph

47 commits

Author SHA1 Message Date
jmdavis
dd3a0c20a2 Created std.ascii to replace std.ctype.
All of the new, properly camelcased functions in std.ctype have been
moved to std.ascii, and std.ctype has been scheduled for deprecation.
2011-06-14 04:06:54 -07:00
jmdavis
654f35a677 Replaced calls to std.string and std.ctype's tolower with their toLower counterparts. 2011-06-12 16:59:52 -07:00
jmdavis
19ae2b4998 Replace calls to std.ctype.isdigt with std.ctype.isDigit. 2011-06-12 16:59:51 -07:00
jmdavis
ba7d70b858 Fix for issue 6113.
I really should have made those static constructors shared in the first
place, since immutable class and global variables are implicitly shared.
2011-06-05 23:23:10 -07:00
jmdavis
3b628aeb50 Fix to get around issue# 6013. 2011-05-15 19:18:01 -07:00
jmdavis
cf497ec89a Made a public alias private like it should have been in the first place. 2011-05-15 04:06:28 -07:00
jmdavis
1077af7e27 Fixed a typo in my fix for typos. :( 2011-05-10 19:18:33 -07:00
jmdavis
a7d5e3889e Fixed some typos in std.datetime's documentation. 2011-05-10 19:15:11 -07:00
jmdavis
fa8aa916d1 A couple of fixes from Andrei's suggestions. 2011-04-25 00:07:48 -07:00
jmdavis
4f27ab5227 Some formatting changes. 2011-04-19 00:40:45 -07:00
jmdavis
ac392c58be Fix for Issue# 5781.
http://d.puremagic.com/issues/show_bug.cgi?id=5781

Unfortunately, _all_ of the unit tests are now disabled on Windows
(instead of just most of them). Issue #5454 seems to be worse at present.
Hopefully Don's changes to CTFE will help.
2011-04-18 23:33:59 -07:00
jmdavis
218b3f9bc4 A few documentation adjustments. 2011-04-08 22:51:27 -07:00
jmdavis
09483e8af6 Renamed to/fromISOExtendedString to to/fromISOExtString.
toISOExtendedString is annoyingly long - albeit wonderfully accurate -
and toISOExtString seems accurate enough and enough shorter to be worth
the switch. The old names are scheduled to be deprecated.
2011-04-08 22:44:00 -07:00
jmdavis
8e4b25d66e Fix Issue# 5794.
Some documentation fixes for StopWatch and benchmark. I reworked some of
the code as well.

http://d.puremagic.com/issues/show_bug.cgi?id=5794
2011-04-06 01:17:20 -07:00
jmdavis
a08e625bad Fixed bug in setTZEnvVar.
putenv actually keeps a pointer to the string that it's passed, which
setTZEnvVar didn't take into account, so putenv risked having an invalid
pointer as soon as a garbage collection cycle was run. This is an
example of a bug that's easier to find in C++. The inderministic nature
of garbage collection makes it much more insidious. But it's the kind of
thing that's really only going to happen when interacting with code that
isn't D code.
2011-04-02 06:13:32 -07:00
jmdavis
cd3a97c0f6 More improvements to std.datetime's unit tests. 2011-04-02 05:08:03 -07:00
jmdavis
a34673cc82 Fix for bug# 5761.
http://d.puremagic.com/issues/show_bug.cgi?id=5761

A subtle math error involving leap years caused Dec-30 and Dec-31 of A.D.
leap years and Jan-01 and Jan-02 of B.C. leap years to be off by one day.

The revised tests catch the bug.
2011-03-26 16:29:28 -07:00
jmdavis
5e9b52a149 More adjustments to std.datetime's unit tests.
They tests that were changed are a bit scattered, because I was trying
to pick the tests that were related to the test failure in SysTime's day
getter property (which is a manifestation of bug# 5761).
2011-03-26 16:29:28 -07:00
jmdavis
dd91939d49 Initial commit for the reworking of std.datetime's unit tests as requested.
There should be no functional changes to the code - only the unit tests.
Also, the lines which have been changed are now mostly within 80
characters, and those that are over are not over by much. Only a portion
of the tests have been updated, but I'm doing it in chunks.
2011-03-26 16:29:28 -07:00
jmdavis
24142d7bef Merge in Pull Request #12 of D-Programming-Language / phobos.
Conflicts:
	std/datetime.d
2011-03-21 22:38:57 -07:00
jmdavis
e2bfeab535 Some adjustments to the unit tests involving getTimeZone. 2011-03-14 01:45:30 -07:00
jmdavis
2a9e456628 Fixed bug# 5731.
http://d.puremagic.com/issues/show_bug.cgi?id=5731
2011-03-13 20:21:37 -07:00
jmdavis
a585d68a67 Adjusted std.datetime for changes to std.exception.
assertThrown, assertNotThrown, and collectExceptionMsg were removed
from std.datetime, since they're in std.exception now, and assertPred
was renamed to _assertPred in case anyone is trying to use the function
which was under review in their own code (since all templates are
currently public even if declared private).

There should be no functional changes to std.datetime. It's just
adjusting which versions of the unit test functions get called.
2011-03-05 21:42:41 -08:00
Brad Roberts
8c8bc45d2b Fix version identifier from Linux to linux, sigh 2011-02-20 03:19:38 -08:00
Brad Roberts
a536c89336 the UTC zone file isn't in the same place on freebsd as linux and osx. 2011-02-20 04:04:49 +00:00
jmdavis
ac040713d3 std.datetime fixed so that it doesn't need the daylight variable on Posix.
It will still use daylight if it's there, but since FreeBSD doesn't have
it for some reason (in spite of the fact that the daylight variable is
part of Posix), we can't assume that it's there.

Also, now that tzname is in druntime, it has been removed from
std.datetime.

This should fix bug# 5616.
2011-02-19 23:15:29 -08:00
Sohgo Takeuchi
85cf065e99 fixed an error message. 2011-02-19 12:38:19 +09:00
jmdavis
18cdcdc298 Merged in Pull Request #5 for D-Programming-Language / phobos. 2011-02-12 05:57:44 -08:00
jmdavis
3dd26c2eac Clock.currTime() shouldn't be a property, since it takes a TimeZone. 2011-02-11 20:59:19 -08:00
jmdavis
f5e289d8e8 Improvements to std.datetime's documentation.
I mostly cleaned up and made what was already there more consistent, but
I also reduced some of the documentation in cases where there were
multiple template specializations which differed only by template
constraints and not by signature, so it looked like the same function
was showing up multiple times in the documentation (since the
documentation doesn't show the template constraints). Also, most, if not
all, of the documentation is now within 80 characters per line, though I
haven't done anything to reduce the width of the code lines yet.

I'll work on finding ways to reduce the amount of documentation without
degrading its quality later.
2011-02-11 02:20:31 -08:00
jmdavis
0e69424fa4 Fixed bug# 5552. DosFileTime/SysTime conversions were off by 1 month. 2011-02-08 23:58:02 -08:00
Walter Bright
046e1b36db add source links 2011-02-06 15:46:50 -08:00
Jonathan M Davis
59eb1b70a5 More documentation fixes. 2011-01-22 15:49:03 +00:00
Jonathan M Davis
11f2899ab5 Various adjustments to the documentation in std.datetime and std.file.
This should fix the current ddoc build errors or Windows.
2011-01-22 09:48:29 +00:00
Jonathan M Davis
6c89581e2f Some tweaks to some of the std.datetime unit tests.
Also, the Windows-specific unit tests have now been enabled. So, while
unfortunately, we can't currently have them all enabled on Windows,
since it causes dmd to run out of memory, we can at least get the
Windows-specific stuff tested. Hopefully, the fact that the rest are
running on Linux will be enough for now as far as the other tests go.
2011-01-20 10:20:05 +00:00
Jonathan M Davis
020f6cf394 Fixed some issues with time zone names which worked on wine but not an Windows due to some differences between the two. 2011-01-20 05:06:08 +00:00
Jonathan M Davis
d8488a9865 Phobos has now been changed to use std.datetime. Also, bug# 3848 has been fixed.
std.gregorian, std.date, and std.dateparse have all been marked as
scheduled for deprecation. Everywhere (except for std.file) which was
using std.date is now using std.datetime. std.file is now using
std.datetime but has a number of functions still using d_time but which
are marked as scheduled for deprecation. I tried to give as many as I
could pragmas indicating that they were scheduled for deprecation, but
at the moment, that requires that a function be a templated function, and
I couldn't templatize all of them. So, some functions in std.file are
only marked as scheduled for deprecation in their documentation and will
not give any warning on compilation.

I had to rename several functions in std.file in order to avoid making
any breaking changes. And since I was already having to mess with
function names, it seemed like a good time to change the names of a
number of the functions in std.file to use proper capitalization
(such as changing isdir to isDir) as has been discussed and overwhelmingly
supported in the newsgroup with regards to std.string. And since I was
making those changes, it seemed like a good time to fix bug# 3848
(functions in std.file don't take symbolic links into account) as well.
So, std.file should now deal with symlinks properly.

The issue which Andrei brought up with +VERSION causing the std.datetime
unit tests to fail on OSX has been fixed as well.
2011-01-19 11:10:18 +00:00
Andrei Alexandrescu
c2f018066a Changed signature of findSkip, scheduled indexOf for deprecation, removed obsolete unittests 2011-01-17 08:36:59 +00:00
Jonathan M Davis
9d30071ea7 Some updates to std.datetime.
Among other things, fixes unit test failure on Mac OS X when it fails to
find /usr/share/zoneinfo/right/America/Los_Angeles.
2011-01-16 12:38:36 +00:00
Jonathan M Davis
c5f205a137 Re-enabled std.datetime for Windows but disabled its unit tests for Windows.
For some reason, the std.datetime unit tests compile and pass without
problems on Linux and in Wine on Linux, but on real Windows, the
compiler runs out of memory when compiling them. So, for now, all of the
std.datetime unit tests are versioned with testStdDateTime. On Posix,
version=testdStdDateTime is used in std.datetime, so the tests will run,
but that version is not set on Windows, so the unit tests don't run on
Windows. So, if you want to run the std.datetime unit tests on Windows or
under Wine or Linux, then compile with -version=testStdDateTime.

At the moment, all of the tests pass on both Linux and under Wine, and
the normal code does compile on proper, so I'm fairly certain that it's fine
for use on Windows, but for now, I can't enable the tests on Windows. My
best guess is that it's some sort of weird compiler bug involving system
calls that leak memory on Windows-proper but not in Wine, but I really
don't know.
2011-01-14 11:36:15 +00:00
Jonathan M Davis
038924e4f9 Made a unit test more lenient, so it won't result in semi-random failures. 2011-01-13 11:55:14 +00:00
Jonathan M Davis
fa729a3d02 Temporarily disabling std.datetime on Windows. 2011-01-13 08:55:45 +00:00
Jonathan M Davis
5decc9ce43 Some fixes for the Windows build. 2011-01-12 11:18:31 +00:00
Jonathan M Davis
4b8ebb3871 New std.datetime added.
Nothing in Phobos has been made to use it yet and nothing has yet been
marked as deprecated or scheduled for deprecation due to the new
std.datetime being checked in. That's for a future commit.
2011-01-12 09:13:50 +00:00
SHOO
c6aeea9131 Minor update. 2011-01-11 16:02:32 +00:00
SHOO
7cd2e0339e std.datetime: Added benchmark
This function came from std.date.
But now, benchmark returns Ticks[N] and don't use result argument.
I removed need to use GC for by doing it in this way.
2010-09-18 11:04:14 +00:00
SHOO
3f7580f002 Added std.datetime
1. deprecate std.perf (I added pragma(msg, "...").)
2. Define std.datetime, paste std.stopwatch in it.
I look at the state about the time handling.
2010-09-18 06:20:26 +00:00
Renamed from std/stopwatch.d (Browse further)