Edge Rewrite
// request.cf · coarse context

A page that knows where it met you.

Only coarse request metadata is shown. This demo does not display or persist visitor IP addresses.

Country
US
Cloudflare location
CMH
Connection
HTTP/2
Language
Not provided

Ray ID: a21be7aa7a5e6e2a

Jump to content

Module:Object weight/testcases

From Wikipedia, the free encyclopedia
-- Unit tests for [[Module:Object weight]]. Click talk page to run tests.
local p = require('Module:UnitTests')

function p:test_weight()
	self:preprocess_equals_preprocess_many('{{#invoke:object weight/sandbox|weight|', '}}', '{{#invoke:object weight|weight|', '}}',
		{
			{'123 grams'},
			{'123 gram'},
			{'123 gs'},
			{'123 g.'},
			{'123 g,'},
			{'123 ounces'},
			{'123 ounce'},
			{'123 oz,'},
			{'123 oz.'},
			{'123 grams (body only)'},
			{'123 gram (body only)'},
			{'123 gs (body only)'},
			{'123 g. (body only)'},
			{'123 g, (body only)'},
			{'123 ounces (body only)'},
			{'123 ounce (body only)'},
			{'123 oz, (body only)'},
			{'123 oz. (body only)'},
			{'123 ounce <ref>{{cite web|url=www.google.com}}</ref>'}
		}, {nowiki = 1})
end

function p:test_weight_should_not_convert()
	self:preprocess_equals_preprocess_many('{{#invoke:object weight/sandbox|weight|', '}}', '{{#invoke:object weight|weight|', '}}',
		{
			{'123 LBS'},
			{'123 Pounds'}
		}, {nowiki = 1})
end
return p