Module:Calendário/Testes unitários

-- Testes unitários para o Módulo:Calendário. Clique na página de discussão para rodar os testes. local p = require('Módulo:UnitTests')

function p:test_gregorian2julian self:preprocess_equals('', '17-12-2018') self:preprocess_equals('', '19-12-1999') self:preprocess_equals('', '19-12-1900') self:preprocess_equals('', '20-12-1899') self:preprocess_equals('', 'Erro ao passar data: +30-12-2018') end

function p:test_julian2gregorian self:preprocess_equals('', '30-12-2018') self:preprocess_equals('', '01-01-2000') self:preprocess_equals('', '01-01-1901') self:preprocess_equals('', '01-01-1900') self:preprocess_equals('', 'Erro ao passar data: +30-12-2018') end

function p:test_dayofweek self:preprocess_equals('', 'domingo') self:preprocess_equals('', 'sábado') self:preprocess_equals('', 'terça-feira') self:preprocess_equals('', 'segunda-feira') self:preprocess_equals('', 'Erro ao passar data: +30-12-2018') end

function p:test_date2jdn self:preprocess_equals('', '2458483') self:preprocess_equals('', '2458483') end

return p