Jump to content

Module:Random/testcases

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Mr. Stradivarius (talk | contribs) at 10:43, 26 November 2013 (add date test cases). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Number

Code Main Sandbox
{{#invoke:random|number}} 0.26395581674946 0.90022399690944
{{#invoke:random|number|10}} 1 7
{{#invoke:random|number|10|20}} 13 11
{{#invoke:random|number|500000}} 496 131282
{{#invoke:random|number|-10}} -5 -2
{{#invoke:random|number|20|10}} 15 14
{{#invoke:random|number|-100|-50}} -83 -82
{{#invoke:random|number|6.5}} 6 7
{{#invoke:random|number|-6.5}} -2 -3
{{#invoke:random|number|-16.5|-6.5}} -11.5 -13.5

Date

Code Main Sandbox
{{#invoke:random|date}} 20:20, 15 June 2025 (UTC) 11:12, 02 April 2025 (UTC)
{{#invoke:random|date|1 Jan 2000}} 16:13, 27 February 1971 (UTC) 15:58, 21 March 1985 (UTC)
{{#invoke:random|date|1 Jan 2000|27 July 2176}} 05:14, 21 October 2029 (UTC) 23:41, 07 November 2168 (UTC)
{{#invoke:random|date|1000|2000|format=Y}} 1099 1240
{{#invoke:random|date|2000|1000|format=Y}} Module:Random error: the start date must not be later than the end date (start date: "2000", end date: "1000"). Module:Random error: the start date must not be later than the end date (start date: "2000", end date: "1000").
{{#invoke:random|date|format=Y/m/d H:i}} 2025/11/26 03:04 2025/05/14 19:21