Module:Vanguard funds/testcases

-- Unit tests for Module:Vanguard funds. Click talk page to run tests. -- Example usage: --  -- Console example: --  mw.log(p.run_tests(mw.getCurrentFrame))

local p = require('Module:UnitTests')

function p:test_lookup_known_mutual_funds self:preprocess_equals("", "f:vtsax") self:preprocess_equals("", "f:vtsax") self:preprocess_equals("", "f:vtsax") end

function p:test_lookup_known_ETFs self:preprocess_equals("", "e:vti") self:preprocess_equals("", "e:vti") self:preprocess_equals("", "e:vti") end

function p:test_lookup_missing_entries self:preprocess_equals("", "undefined") self:preprocess_equals("", "undefined") end

function p:test_url_known_mutual_funds local boilerplate = "|https://search/|https://fund/|https://etf/" self:preprocess_equals(		"", "https://fund/vtsax",		{nowiki = true}) self:preprocess_equals(		"", "https://fund/vtsax",		{nowiki = true}) self:preprocess_equals(		"", "https://fund/vtsax",		{nowiki = true}) end

function p:test_url_known_ETFs local boilerplate = "|https://search/|https://fund/|https://etf/" self:preprocess_equals(		"", "https://etf/vti",		{nowiki = true}) self:preprocess_equals(		"", "https://etf/vti",		{nowiki = true}) self:preprocess_equals(		"", "https://etf/vti",		{nowiki = true}) end

function p:test_url_missing_entries local boilerplate = "|https://search/|https://fund/|https://etf/" self:preprocess_equals(		"",		"https://search/",		{nowiki = true}) self:preprocess_equals(		"",		"https://search/",		{nowiki = true}) end

return p