From 65ce68a3a74a7cacb567b22f961d91f584af3e4a Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 7 Apr 2023 12:56:18 +0300 Subject: Improve sort1 test case. --- test/ChangeLog | 5 +++++ test/sort1.awk | 12 ++++++++++++ test/sort1.ok | 40 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+) (limited to 'test') diff --git a/test/ChangeLog b/test/ChangeLog index e7f6a45c..1d6f5427 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2023-04-07 zhou shuiqing + + * sort1.awk: Add tests for ind_num_desc and @ind_str_asc. + * sort1.ok: Updated. + 2023-03-09 Arnold D. Robbins * badargs.ok: Update after code changes. diff --git a/test/sort1.awk b/test/sort1.awk index ef28e9cd..78840bf8 100644 --- a/test/sort1.awk +++ b/test/sort1.awk @@ -21,6 +21,18 @@ BEGIN{ printf("---end asort(a, b, \"%s\"), IGNORECASE = %d---\n", SORT_STR, IGNORECASE) + makea(a) + SORT_STR = "@ind_num_desc" + asort1(a, "") + printf("---end asort(a, b, \"%s\"), IGNORECASE = %d---\n", + SORT_STR, IGNORECASE) + + makea(a) + SORT_STR = "@ind_str_asc" + asort1(a, "") + printf("---end asort(a, a, \"%s\"), IGNORECASE = %d---\n", + SORT_STR, IGNORECASE) + makea(a) SORT_STR = "@ind_str_desc" asort1(a, "") diff --git a/test/sort1.ok b/test/sort1.ok index 00ed661a..d8b6d94f 100644 --- a/test/sort1.ok +++ b/test/sort1.ok @@ -47,6 +47,26 @@ [4]: Zebra [5]: blattt [6]: barz +---end asort(a, b, "@ind_num_desc"), IGNORECASE = 0--- + [1]: barz + [2]: blattt + [3]: Zebra + [4]: 1234 + [5]: 234 + [6][1]: 4321 + [6][2]: arbeZ + [6][3]: tttalb + [6][4]: zrab +---end asort(a, a, "@ind_str_asc"), IGNORECASE = 0--- + [1][1]: zrab + [1][2]: tttalb + [1][3]: arbeZ + [1][4]: 4321 + [2]: 234 + [3]: 1234 + [4]: Zebra + [5]: blattt + [6]: barz ---end asort(a, a, "@ind_str_desc"), IGNORECASE = 0--- [4]: 1234 [5]: 234 @@ -157,6 +177,26 @@ [4]: Zebra [5]: blattt [6]: barz +---end asort(a, b, "@ind_num_desc"), IGNORECASE = 1--- + [1]: barz + [2]: blattt + [3]: Zebra + [4]: 1234 + [5]: 234 + [6][1]: 4321 + [6][2]: arbeZ + [6][3]: tttalb + [6][4]: zrab +---end asort(a, a, "@ind_str_asc"), IGNORECASE = 1--- + [1][1]: zrab + [1][2]: tttalb + [1][3]: arbeZ + [1][4]: 4321 + [2]: 234 + [3]: 1234 + [4]: Zebra + [5]: blattt + [6]: barz ---end asort(a, a, "@ind_str_desc"), IGNORECASE = 1--- [4]: 1234 [5]: 234 -- cgit v1.2.1