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.88150238053943 0.83478934217002
{{#invoke:random|number|10}} 7 8
{{#invoke:random|number|10|20}} 19 15
{{#invoke:random|number|500000}} 346571 433142
{{#invoke:random|number|-10}} 0 -2
{{#invoke:random|number|20|10}} 20 10
{{#invoke:random|number|-100|-50}} -68 -88
{{#invoke:random|number|6.5}} 6 3
{{#invoke:random|number|-6.5}} -4 -5
{{#invoke:random|number|-16.5|-6.5}} -12.5 -10.5

Date

Code Main Sandbox
{{#invoke:random|date}} 16:34, 15 October 2025 (UTC) 02:11, 17 June 2025 (UTC)
{{#invoke:random|date|1 Jan 2000}} 08:18, 08 October 1974 (UTC) 07:15, 07 February 1986 (UTC)
{{#invoke:random|date|1 Jan 2000|27 July 2176}} 13:45, 11 November 2144 (UTC) 17:01, 09 November 2112 (UTC)
{{#invoke:random|date|1000|2000|format=Y}} 1439 1719
{{#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/10/07 15:02 2025/09/13 17:53