-- test ad_to_bs function
SELECT ad_to_bs('2001-02-01'::date);
SELECT ad_to_bs('1972-02-17');
SELECT ad_to_bs('04-24-2026');
SELECT AD_TO_BS('1968-10-7');

-- test bs_date explicit cast operations
SELECT '2057/10/19'::bs_date;
SELECT CAST('2057/10/19' as bs_date);
-- test cast round trip
select ('2057/10/19'::bs_date)::text;
select ('2057/10/19'::bs_date)::bs_date;

-- test to_char function overload for bs_date
SELECT to_char('2057/10/19'::bs_date, 'YYYY-MM-DD');
SELECT to_char('2057/10/19'::bs_date, 'DD/MM/YYYY');
SELECT to_char('2057/10/19'::bs_date, 'MM-DD-YY');

SELECT to_char('2057/10/19'::bs_date, 'Month DD, YYYY');
SELECT to_char('2057/10/19'::bs_date, 'Mon DD, YY');
SELECT to_char('2057/10/19'::bs_date, 'Day, DD Month YYYY');
SELECT to_char('2057/10/19'::bs_date, 'Dy, DD Mon YY');

SELECT to_char('2057/10/19'::bs_date, 'MONTH');
SELECT to_char('2057/10/19'::bs_date, 'month');
SELECT to_char('2057/10/19'::bs_date, 'MON');
SELECT to_char('2057/10/19'::bs_date, 'mon');
SELECT to_char('2057/10/19'::bs_date, 'DAY');
SELECT to_char('2057/10/19'::bs_date, 'day');

SELECT to_char('2057/10/19'::bs_date, 'YYYY-MM-DD', 'dev');
SELECT to_char('2057/10/19'::bs_date, 'Day, DD Month YYYY', 'dev');
SELECT to_char('2057/10/19'::bs_date, 'Dy, DD Mon YY', 'dev');
SELECT to_char('2057/10/19'::bs_date, 'DD/MM/YYYY', 'dev');

SELECT to_char('2057/10/19'::bs_date, 'Date: Day, DD Month, YYYY');
SELECT to_char('2057/10/19'::bs_date, 'मिति: Day, DD Month, YYYY', 'dev');

-- test current_bs_date (just check if it returns a valid bs_date type)
-- current_bs_date cannot be tested with pg_regress because it is not deterministic
SELECT pg_typeof(current_bs_date());