Fix the compilation failure

This commit is contained in:
houyingchao 2022-02-19 17:08:17 +08:00
parent 624b3fd167
commit 03128c5e45
2 changed files with 48 additions and 2 deletions

View File

@ -0,0 +1,38 @@
diff --git a/test/unit/debug.rb b/test/unit/debug.rb
index 88baf56..b694f21 100644
--- a/test/unit/debug.rb
+++ b/test/unit/debug.rb
@@ -24,7 +24,8 @@ class DebugEncoderTest < Test::Unit::TestCase
[" \n", :space],
["[]", :method],
[:end_line, :head],
- ].flatten
+ ]
+ TEST_INPUT.flatten!
TEST_OUTPUT = <<-'DEBUG'.chomp
integer(10)operator((\\\))string<content(test)>head[
diff --git a/test/unit/statistic.rb b/test/unit/statistic.rb
index 1326dca..776774d 100644
--- a/test/unit/statistic.rb
+++ b/test/unit/statistic.rb
@@ -24,7 +24,8 @@ class StatisticEncoderTest < Test::Unit::TestCase
[" \n", :space],
["[]", :method],
[:end_line, :test],
- ].flatten
+ ]
+ TEST_INPUT.flatten!
TEST_OUTPUT = <<-'DEBUG'
Code Statistics
@@ -56,4 +57,4 @@ Token Types (7):
assert_equal TEST_OUTPUT, TEST_INPUT.statistic
end
-end
\ No newline at end of file
+end
--
2.29.2

View File

@ -2,7 +2,7 @@
Name: rubygem-%{gem_name} Name: rubygem-%{gem_name}
Version: 1.1.2 Version: 1.1.2
Release: 1 Release: 2
Summary: Fast syntax highlighting for selected languages Summary: Fast syntax highlighting for selected languages
License: MIT License: MIT
URL: http://coderay.rubychan.de URL: http://coderay.rubychan.de
@ -11,6 +11,7 @@ Source1: https://github.com/rubychan/coderay/archive/v1.1.2.tar.gz#/
# Remove extended Tokens#filter for Ruby 2.6 compatibility. # Remove extended Tokens#filter for Ruby 2.6 compatibility.
# https://github.com/rubychan/coderay/pull/233 # https://github.com/rubychan/coderay/pull/233
Patch0000: rubygem-coderay-1.1.2-remove-Array-filter-for-ruby-2.6.patch Patch0000: rubygem-coderay-1.1.2-remove-Array-filter-for-ruby-2.6.patch
Patch0001: rubygem-coderay-1.1.3-fix-tests-Array-on-ruby-3.0.patch
BuildRequires: ruby(release) rubygems-devel ruby >= 1.8.6 rubygem(test-unit) BuildRequires: ruby(release) rubygems-devel ruby >= 1.8.6 rubygem(test-unit)
BuildArch: noarch BuildArch: noarch
%description %description
@ -25,7 +26,8 @@ BuildArch: noarch
Documentation for %{name}. Documentation for %{name}.
%prep %prep
%autosetup -n %{gem_name}-%{version} -p1 %setup -n %{gem_name}-%{version}
%patch0000 -p1
%build %build
gem build ../%{gem_name}-%{version}.gemspec gem build ../%{gem_name}-%{version}.gemspec
@ -43,6 +45,9 @@ find %{buildroot}%{gem_instdir}/bin -type f | xargs chmod a+x
%check %check
pushd .%{gem_instdir} pushd .%{gem_instdir}
tar xzvf %{SOURCE1} tar xzvf %{SOURCE1}
pushd ./%{gem_name}-%{version}/
patch -p1 < %_sourcedir/rubygem-coderay-1.1.3-fix-tests-Array-on-ruby-3.0.patch
popd
# See https://github.com/rubychan/coderay/blob/master/rake_tasks/test.rake # See https://github.com/rubychan/coderay/blob/master/rake_tasks/test.rake
LANG=C.UTF-8 LANG=C.UTF-8
ruby ./%{gem_name}-%{version}/test/functional/suite.rb ruby ./%{gem_name}-%{version}/test/functional/suite.rb
@ -64,5 +69,8 @@ popd
%doc %{gem_instdir}/README_INDEX.rdoc %doc %{gem_instdir}/README_INDEX.rdoc
%changelog %changelog
* Sat Feb 19 2022 houyingchao <houyingchao@huawei.com> - 1.1.2-2
- Fix the compilation failure
* Sat Jul 25 2020 wangxiao <wangxiao65@huawei.com> - 1.1.2-1 * Sat Jul 25 2020 wangxiao <wangxiao65@huawei.com> - 1.1.2-1
- package init - package init