Hi Collin,

On 7/18/25 05:03, Collin Funk wrote:
I've attached a basic test I wrote for the Thai solar calendar using
th_TH.UTF-8 based on the properties that Bruno described [1].

> +# Current year in the Gregorian calendar.
> +current_year=$(LC_ALL=C date +%Y)
> +
> +export LC_ALL=th_TH.UTF-8
> +
> +# Since 1941, the year in the Thai solar calendar is the Gregorian year plus
> +# 543.
> +test $(date +%Y) == $(($current_year + 543)) || fail=1
____________________^^_^^^___________________^^
That is 2x bash syntax, and at least the == is flagged by:

  maint.mk: use "test x = x", not "test x == x"
  make: *** [maint.mk:1218: sc_prohibit_test_double_equal] Error 1

Better use expr(1) instead of $(( )).

I'm also getting this failure here:

  ++ LC_ALL=C
  ++ date +%Y
  + current_year=2025
  + export LC_ALL=th_TH.UTF-8
  + LC_ALL=th_TH.UTF-8
  ++ date +%Y
  + test 2025 == 2568
  + fail=1

> +# All months that have 31 days end have names that end with "คม".
> +for month in 01 03 05 07 08 10 12; do
> +  date --date=$current_year-$month-01 +%B | grep คม$ || fail=1
____________________________________________________^^^

Non-ascii characters are hard to use/read.
I suggest checking for the UTF value instead - something like:

  date ... | od -tx1z -w500 | grep -F '84 e0 b8 a1 0a'

WDYT?

Have a nice day,
Berny

Reply via email to