|
128 | 128 | (error (format "[failed to retrieve: %S]" error))))))))))
|
129 | 129 |
|
130 | 130 |
|
| 131 | +(ert-deftest datetime-locale-database-sanity () |
| 132 | + (dolist (locale (datetime-list-locales t)) |
| 133 | + (let ((decimal-separator (datetime-locale-field locale :decimal-separator)) |
| 134 | + (eras (datetime-locale-field locale :eras)) |
| 135 | + (month-context-abbr (datetime-locale-field locale :month-context-abbr)) |
| 136 | + (month-context-names (datetime-locale-field locale :month-context-names)) |
| 137 | + (weekday-context-abbr (datetime-locale-field locale :weekday-context-abbr)) |
| 138 | + (weekday-context-names (datetime-locale-field locale :weekday-context-names)) |
| 139 | + (month-standalone-abbr (datetime-locale-field locale :month-standalone-abbr)) |
| 140 | + (month-standalone-names (datetime-locale-field locale :month-standalone-names)) |
| 141 | + (weekday-standalone-abbr (datetime-locale-field locale :weekday-standalone-abbr)) |
| 142 | + (weekday-standalone-names (datetime-locale-field locale :weekday-standalone-names)) |
| 143 | + (am-pm (datetime-locale-field locale :am-pm))) |
| 144 | + (ert-info ((format "\ |
| 145 | +locale = %S |
| 146 | +decimal-separator = %S |
| 147 | +eras = %S |
| 148 | +month-context-abbr = %S |
| 149 | +month-context-names = %S |
| 150 | +weekday-context-abbr = %S |
| 151 | +weekday-context-names = %S |
| 152 | +month-standalone-abbr = %S |
| 153 | +month-standalone-names = %S |
| 154 | +weekday-standalone-abbr = %S |
| 155 | +weekday-standalone-names = %S |
| 156 | +am-pm = %S" |
| 157 | + locale decimal-separator eras |
| 158 | + month-context-abbr month-context-names |
| 159 | + weekday-context-abbr weekday-context-names |
| 160 | + month-standalone-abbr month-standalone-names |
| 161 | + weekday-standalone-abbr weekday-standalone-names |
| 162 | + am-pm)) |
| 163 | + (should (memq decimal-separator '(?. ?, ?٫))) |
| 164 | + (dolist (entry `((,eras 2) |
| 165 | + (,month-context-abbr 12) |
| 166 | + (,month-context-names 12) |
| 167 | + (,weekday-context-abbr 7) |
| 168 | + (,weekday-context-names 7) |
| 169 | + (,month-standalone-abbr 12) |
| 170 | + (,month-standalone-names 12) |
| 171 | + (,weekday-standalone-abbr 7) |
| 172 | + (,weekday-standalone-names 7) |
| 173 | + (,am-pm 2))) |
| 174 | + (let ((value (car entry)) |
| 175 | + (length (cadr entry))) |
| 176 | + (should (and (vectorp value) (= (length value) length))) |
| 177 | + (dotimes (k length) |
| 178 | + (should (stringp (aref value k)))))))))) |
| 179 | + |
| 180 | + |
131 | 181 | (provide 'test/base)
|
0 commit comments