Commit Graph

6 Commits

Author SHA1 Message Date
Peter Wang
9d23694a25 Thread I/O state through time routines that depend on the time zone.
library/time.m:
	Deprecate non-pure functions `localtime/1' and `mktime/1'.
	They depend on the current time zone, which depends on the
	environment that the program is running in, and may also be
	changed at run time (e.g. by setting the environment variable
	"TZ").

	Add replacement predicates `localtime/4' and `mktime/4' that
	thread the I/O state.

	Deprecate the non-pure function `ctime/1'.  It does not seem
	necessary to add a pure replacement for it, being a minor
	convenience at best.

	Try to clarify some documentation.

library/calendar.m:
	Conform to above changes.

tests/hard_coded/dst_test.m:
tests/hard_coded/time_test.m
	Conform to above changes.

	Update code style.

extras/curs/samples/nibbles.m:
extras/graphics/easyx/samples/bounce.m:
extras/graphics/easyx/samples/mclock.m:
extras/log4m/log4m.m:
	Conform to above changes.

NEWS:
	Announce changes.
2016-06-06 23:14:29 +10:00
Zoltan Somogyi
33eb3028f5 Clean up the tests in half the test directories.
tests/accumulator/*.m:
tests/analysis_*/*.m:
tests/benchmarks*/*.m:
tests/debugger*/*.{m,exp,inp}:
tests/declarative_debugger*/*.{m,exp,inp}:
tests/dppd*/*.m:
tests/exceptions*/*.m:
tests/general*/*.m:
tests/grade_subdirs*/*.m:
tests/hard_coded*/*.m:
    Make these tests use four-space indentation, and ensure that
    each module is imported on its own line. (I intend to use the latter
    to figure out which subdirectories' tests can be executed in parallel.)

    These changes usually move code to different lines. For the debugger tests,
    specify the new line numbers in .inp files and expect them in .exp files.
2015-02-14 20:14:03 +11:00
Julien Fischer
459847a064 Move the univ, maybe, pair and unit types from std_util into their own
Estimated hours taken: 18
Branches: main

Move the univ, maybe, pair and unit types from std_util into their own
modules.  std_util still contains the general purpose higher-order programming
constructs.

library/std_util.m:
	Move univ, maybe, pair and unit (plus any other related types
	and procedures) into their own modules.

library/maybe.m:
	New module.  This contains the maybe and maybe_error types and
	the associated procedures.

library/pair.m:
	New module.  This contains the pair type and associated procedures.

library/unit.m:
	New module. This contains the types unit/0 and unit/1.

library/univ.m:
	New module. This contains the univ type and associated procedures.

library/library.m:
	Add the new modules.

library/private_builtin.m:
	Update the declaration of the type_ctor_info struct for univ.

runtime/mercury.h:
	Update the declaration for the type_ctor_info struct for univ.

runtime/mercury_mcpp.h:
runtime/mercury_hlc_types.h:
	Update the definition of MR_Univ.

runtime/mercury_init.h:
	Fix a comment: ML_type_name is now exported from type_desc.m.

compiler/mlds_to_il.m:
	Update the the name of the module that defines univs (which are
	handled specially by the il code generator.)

library/*.m:
compiler/*.m:
browser/*.m:
mdbcomp/*.m:
profiler/*.m:
deep_profiler/*.m:
	Conform to the above changes.  Import the new modules where they
	are needed; don't import std_util where it isn't needed.

	Fix formatting in lots of modules.  Delete duplicate module
	imports.

tests/*:
	Update the test suite to confrom to the above changes.
2006-03-29 08:09:58 +00:00
James Goddard
cb04e37f22 Revised the test cases for the time library.
Estimated hours taken: 3
Branches: main

Revised the test cases for the time library.

tests/time_test.m:
	mktime(localtime(Time)) is now considered to be close enough to the
	original Time if it is less than 1 second earlier.

tests/dst_test.m:
	Tests daylight savings time is implemented correctly.
	Also tests localtime vs gmtime on the changeover dates.

tests/dst_test.exp:
	corresponding expected output.

tests/Mmakefile:
	Added dst_test to the list.
	Added rule for dst_test, which sets the TZ environmental variable
	to 'Australia/Melbourne' before running the test.
2003-12-17 05:32:16 +00:00
Simon Taylor
7750bab88e Change the order of the fields of type `time__tm' so that
Estimated hours taken: 1
Branches: main, release

library/time.m:
	Change the order of the fields of type `time__tm' so that
	comparison of values of type `tm' whose `tm_dst' fields are identical
	is equivalent to comparison of the times those values represent.

NEWS:
	Document the change.

tests/hard_coded/time_test.m:
	Fix the test case.
2001-05-31 17:12:52 +00:00
Simon Taylor
d9a33680da Fix a bug: type `tm' didn't contain a member to store the
Estimated hours taken: 0.5
Branches: main, release

library/time.m:
	Fix a bug: type `tm' didn't contain a member to store the
	day of the month, so functions which used that member, for
	example time__mktime, would not work.

	Remove some code duplication in the handling of daylight
	saving time.

	Add field names to type `tm'.

NEWS:
	Document the changes to time.m.

tests/hard_coded/Mmakefile:
tests/hard_coded/time_test.{m,exp}:
	Some basic tests of the time module.
2001-05-31 09:11:30 +00:00