зеркало из https://github.com/github/ruby.git
[ruby/prism] Exclude encodings that are dynamic
https://github.com/ruby/prism/commit/6749146c0e
This commit is contained in:
Родитель
6ff9f1aa51
Коммит
242dc537f9
|
@ -5022,10 +5022,6 @@ pm_encoding_find(const uint8_t *start, const uint8_t *end) {
|
|||
ENCODING2("EUC-CN", "eucCN", PM_ENCODING_GB2312);
|
||||
ENCODING2("EUC-TW", "eucTW", PM_ENCODING_EUC_TW);
|
||||
ENCODING1("Emacs-Mule", PM_ENCODING_EMACS_MULE);
|
||||
ENCODING1("external", PM_ENCODING_UTF_8);
|
||||
break;
|
||||
case 'F': case 'f':
|
||||
ENCODING1("filesystem", PM_ENCODING_UTF_8);
|
||||
break;
|
||||
case 'G': case 'g':
|
||||
ENCODING1("GBK", PM_ENCODING_GBK);
|
||||
|
@ -5071,9 +5067,6 @@ pm_encoding_find(const uint8_t *start, const uint8_t *end) {
|
|||
ENCODING1("KOI8-R", PM_ENCODING_KOI8_R);
|
||||
ENCODING1("KOI8-U", PM_ENCODING_KOI8_U);
|
||||
break;
|
||||
case 'L': case 'l':
|
||||
ENCODING1("locale", PM_ENCODING_UTF_8);
|
||||
break;
|
||||
case 'M': case 'm':
|
||||
ENCODING1("macCentEuro", PM_ENCODING_MAC_CENT_EURO);
|
||||
ENCODING1("macCroatian", PM_ENCODING_MAC_CROATIAN);
|
||||
|
|
|
@ -137,9 +137,7 @@ module Prism
|
|||
# These test that we're correctly parsing codepoints for each alias of each
|
||||
# encoding that prism supports.
|
||||
encodings.each do |encoding, range|
|
||||
encoding.names.each do |name|
|
||||
next if name == "locale"
|
||||
|
||||
(encoding.names - %w[external internal filesystem locale]).each do |name|
|
||||
define_method(:"test_encoding_#{name}") do
|
||||
assert_encoding(encoding, name, range)
|
||||
end
|
||||
|
|
Загрузка…
Ссылка в новой задаче