Commit Graph

41 Commits

Author SHA1 Message Date
ryo
638374d825 add test case for new format 'f' and 'F' 2017-10-14 18:41:44 +00:00
kre
992d3e66d8 Fix typo in a comment. 2017-03-22 05:35:33 +00:00
kre
08844cd91f Add tests for "12 noon", "12 midnight". 2017-03-22 01:50:22 +00:00
kre
f8f91559ae Since PR lib/52101 is now fixed, the tests for its bug should no longer fail. 2017-03-22 01:00:19 +00:00
kre
10db8f184b Fix a typo - it doesn't matter now, as the test fails anyway, but
it will matter when parsedate is fixed and the test is supposed to
succeed.
2017-03-21 21:42:18 +00:00
kre
0c8a4b80f9 PR lib/52101
Add 6 extra tests for the 12am/12pm bug - all currently expected to fail.
(That is, 6 subtests of the "times" test will fail, all new ones)>

While here, when parsedate() fails (returns -1) avoid converting that
failure value (-1) to a struct tm (1969-12-31T23:59:59 UTC) and then
comparing the values with those expected by the test, and complaining
about all of those (where ANY was not permitted) that don't match...
2017-03-21 20:06:27 +00:00
kre
bd9b00916f Remove tests of "dawn" and "sunset" in preparation for removing
them from parsedate() itself sometime soon.
2016-06-22 15:01:38 +00:00
kre
25d58d24b2 Make the 9 months ago test, when reverting from late November to the
end of Feburary just a little less bogus (stupid cut & paste error).
2016-05-05 02:12:21 +00:00
gson
85c4af6b99 Reduce the step size, exposing another bug. 2016-05-04 18:36:46 +00:00
kre
e4edd6e6c4 PR bin/50574 - make the tests conform to what parsedate() actually
does, so they should no longer fail.   This needs parsedate.y 1.28
in order to work properly.

OK christos@
2016-05-03 18:18:15 +00:00
kre
97c9ae31d2 Whitespace. No changes. OK christos@ 2016-05-03 18:10:38 +00:00
gson
73fec7e59e In the "relative" test case, run the tests multiple times relative to
various dates over a span of a few decades, instead of just once
relative to the current date.  This makes the test fail consistently
instead of sometimes failing and sometimes not depending on when
it is run.  Makes PR lib/50574 consistently reproducible.
2016-05-01 16:39:47 +00:00
dholland
bb7bd59051 Fix REL_CHECK error output; it had "expected" and "obtained" swapped.
While here, improve the general legibility of the printout. Not
actually relevant to PR 50574, but anyone looking at that should be
aware of this change.
2015-12-31 10:56:13 +00:00
dholland
6970e57cc6 When evaluated on a Sunday, "next Sunday" means 7 days in the future,
not 14. When evaluated on a Monday, it apparently means 13 days in the
future. There's not exactly a spec for parsedate.y, so conform to the
implementation.

PR 50574.

XXX: to me at least this is an odd notion of "next Sunday", but whatever...
2015-12-31 10:18:00 +00:00
dholland
9775679d6b Fix the "Tuesday midnight" test to match what parsedate.y does; in
particular it doesn't add a week if evaluating that on Wednesday.

Whether that's right is an open question, but there's not exactly a
spec for parsedate.y and there's no point having the test fail one
day in seven.

PR 50574.
2015-12-31 10:10:15 +00:00
christos
8861b14877 Kill one more REL_DEBUG, from kre 2015-12-08 12:41:28 +00:00
christos
da8d5d2ae7 there is no REL_DEBUG 2015-12-07 20:57:39 +00:00
christos
432cd4b9b7 new tests from kre 2015-12-07 20:52:46 +00:00
apb
4206688740 2013-07-09 was in British Summer TIme, so use tzoff=-60, not 0. 2014-10-08 17:23:03 +00:00
apb
5b0c63042a When tests fail, print all args, notjust the date string. 2014-10-08 17:21:40 +00:00
apb
4e0616873f Add tests for PR lib/47916. Some of these fail. 2014-10-08 13:26:47 +00:00
apb
cad616778a Adapt to a recent change in parsedate().
"9/10/69" still refers to 2069, and "9/10/70" still refers to 1970,
but "69-09-10" and "70-09-10" now refer to the years 69 and 70.
2014-10-07 22:33:52 +00:00
apb
cf077958e6 Add comments for some non-obvious cases.
Also add a test with year=70, which is documented to be treated as 1970.
2014-10-07 19:26:31 +00:00
apb
fc447ec4e5 Add local parsecheck() function and use it for several tests.
Instead of just checking that parsedate(3) does not return an error,
also pass the result through localtime_r(3) or gmtime_r(3) and check the
year/month/day/hour/minute/second fields in the resulting struct tm.
2014-10-07 19:20:28 +00:00
shm
fc03103b46 PR/48517 testcase provided by Felix Deichmann 2014-06-06 06:59:21 +00:00
pgoyette
f6bf860e63 Arghhh! Typo. 2013-08-08 05:10:07 +00:00
pgoyette
26735a61a7 Add a new test case for snprintb_m(3) to catch previous boundary bug. 2013-08-08 04:52:10 +00:00
apb
a39eba5e76 Test parsedate("@-2",...) (should return -2 and not set errno);
and parsedate("@junk",...) (should return -1 and set errno).
We were already testing "@-1".
2013-01-19 15:21:43 +00:00
apb
58e1304b9b * Test that parsedate("@0", ...) returns (time_t)0 regardless of timezone.
* Test that parsedate("@-1", NULL, NULL) returns (time_t)-1
  without setting errno.
2013-01-19 14:03:08 +00:00
christos
6298c31a51 add missing includes 2012-11-04 23:37:02 +00:00
jruoho
72ed5c064e To be on the safe side, use the category/number notation when referring to
PRs (otherwise third-party sed-scripts might miss the references). Also
remove white-space.
2012-03-18 07:14:08 +00:00
christos
5d71dc0bd6 mention the PR# in the description like everyone else. 2012-03-17 21:33:13 +00:00
apb
7cf05991c0 Add some tests for dates several centures into the past and future.
These currently fail, but I'll fix that soon.
2011-12-17 19:07:34 +00:00
jruoho
d19079bc52 Add missing __RCSID(3), again. 2011-03-30 17:03:02 +00:00
jruoho
2289b490a3 Add some naive tests for the efun(3) family of debug functions. 2011-03-30 17:02:17 +00:00
jmmv
255271589f Extend pidfile(3) to support creating pid files in arbitrary locations.
If the argument provided to pidfile(3) contains a '/', then the value is
considered to be an absolute/relative path and the pid file is created
in the given location.

Otherwise, pidfile(3) behaves as before and treats the provided value as
a basename to construct a pid file in /var/run/<basename>.pid.  This means
that to create a pid file named "foo.pid" in the current directory, one
must specify "./foo.pid".
2011-03-29 13:55:37 +00:00
jmmv
a6fb334d92 Clean up some late-night braindeadness:
- Make the pidfile name generation functions return their value as a return
  value, not an output pointer.  And homogenize these into a single function.
- Free allocated memory.  Not truly necessary because the test cases die
  immediately anyway, but nice to do.
- Remove the pidfile__ prefix from test case names.  (This was in advance of
  some changes I want to propose to pidfile(3), but it turns out my approach
  was flawed.  Preemptive smartness is evil!)
2011-03-23 09:13:54 +00:00
jmmv
f8d6f5f369 Add some tests for pidfile(3).
I want to touch this module to attempt a feature addition but I need some
tests beforehand!
2011-03-22 23:07:32 +00:00
christos
1f98304948 We don't expect tests to fail anymore. 2010-12-21 00:24:14 +00:00
njoly
198de556b0 Add testcase from PR/44255, that exercize parsedate(3) with sample
strings taken from the manpage.
2010-12-20 16:23:01 +00:00
jmmv
c505c44298 Convert the libposix, libprop, librt, libskey and libutil tests to ATF.
Initial work from the GSoC 2008 project by Lukasz Strzygowski.
2010-07-16 13:56:31 +00:00