# -*- coding: utf-8 -*- =begin Copyright (C) 2014 Takashi SUGA You may use and/or modify this file according to the license described in the LICENSE.txt file included in this archive. =end module MiniTest class Bahai < MiniTest::TestCase def test_bahai date = When.when? '1.9.1.1.1^^Bahai?location=(_co:Iranian::Tehran)' [["01.09.01.01.01", "1996-03-20", 2450163], ["01.09.02.01.01", "1997-03-20", 2450528], ["01.09.03.01.01", "1998-03-21", 2450894], ["01.09.04.01.01", "1999-03-21", 2451259], ["01.09.05.01.01", "2000-03-20", 2451624], ["01.09.06.01.01", "2001-03-20", 2451989], ["01.09.07.01.01", "2002-03-21", 2452355], ["01.09.08.01.01", "2003-03-21", 2452720], ["01.09.09.01.01", "2004-03-20", 2453085], ["01.09.10.01.01", "2005-03-20", 2453450], ["01.09.11.01.01", "2006-03-21", 2453816], ["01.09.12.01.01", "2007-03-21", 2454181], ["01.09.13.01.01", "2008-03-20", 2454546], ["01.09.14.01.01", "2009-03-20", 2454911], ["01.09.15.01.01", "2010-03-21", 2455277], ["01.09.16.01.01", "2011-03-21", 2455642], ["01.09.17.01.01", "2012-03-20", 2456007], ["01.09.18.01.01", "2013-03-20", 2456372], ["01.09.19.01.01", "2014-03-21", 2456738], ["01.10.01.01.01", "2015-03-21", 2457103], ["01.10.02.01.01", "2016-03-20", 2457468], ["01.10.03.01.01", "2017-03-20", 2457833], ["01.10.04.01.01", "2018-03-21", 2458199], ["01.10.05.01.01", "2019-03-21", 2458564], ["01.10.06.01.01", "2020-03-20", 2458929], ["01.10.07.01.01", "2021-03-20", 2459294], ["01.10.08.01.01", "2022-03-21", 2459660], ["01.10.09.01.01", "2023-03-21", 2460025], ["01.10.10.01.01", "2024-03-20", 2460390], ["01.10.11.01.01", "2025-03-20", 2460755], ["01.10.12.01.01", "2026-03-20", 2461120], ["01.10.13.01.01", "2027-03-21", 2461486], ["01.10.14.01.01", "2028-03-20", 2461851]].each do |sample| assert_equal(sample, [date.to_s, (When::Gregorian ^ date).to_s, date.to_i]) date += When::P1Y end date = When.when? '2001.3.21' 400.times do assert_equal([1,1], (When.Calendar('Bahai') ^ date).cal_date[-2..-1]) date += When::P1Y end end end end