summaryrefslogtreecommitdiff
path: root/spec/ruby/core/string/shared/eql.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/string/shared/eql.rb')
-rw-r--r--spec/ruby/core/string/shared/eql.rb22
1 files changed, 13 insertions, 9 deletions
diff --git a/spec/ruby/core/string/shared/eql.rb b/spec/ruby/core/string/shared/eql.rb
index 85b861f4f1..0e356c69e8 100644
--- a/spec/ruby/core/string/shared/eql.rb
+++ b/spec/ruby/core/string/shared/eql.rb
@@ -1,34 +1,38 @@
-# -*- encoding: binary -*-
+# encoding: binary
require_relative '../../../spec_helper'
require_relative '../fixtures/classes'
describe :string_eql_value, shared: true do
it "returns true if self <=> string returns 0" do
- 'hello'.send(@method, 'hello').should be_true
+ 'hello'.send(@method, 'hello').should == true
end
it "returns false if self <=> string does not return 0" do
- "more".send(@method, "MORE").should be_false
- "less".send(@method, "greater").should be_false
+ "more".send(@method, "MORE").should == false
+ "less".send(@method, "greater").should == false
end
it "ignores encoding difference of compatible string" do
- "hello".force_encoding("utf-8").send(@method, "hello".force_encoding("iso-8859-1")).should be_true
+ "hello".dup.force_encoding("utf-8").send(@method, "hello".dup.force_encoding("iso-8859-1")).should == true
end
it "considers encoding difference of incompatible string" do
- "\xff".force_encoding("utf-8").send(@method, "\xff".force_encoding("iso-8859-1")).should be_false
+ "\xff".dup.force_encoding("utf-8").send(@method, "\xff".dup.force_encoding("iso-8859-1")).should == false
end
it "considers encoding compatibility" do
- "hello".force_encoding("utf-8").send(@method, "hello".force_encoding("utf-32le")).should be_false
+ "abcd".dup.force_encoding("utf-8").send(@method, "abcd".dup.force_encoding("utf-32le")).should == false
end
it "ignores subclass differences" do
a = "hello"
b = StringSpecs::MyString.new("hello")
- a.send(@method, b).should be_true
- b.send(@method, a).should be_true
+ a.send(@method, b).should == true
+ b.send(@method, a).should == true
+ end
+
+ it "returns true when comparing 2 empty strings but one is not ASCII-compatible" do
+ "".send(@method, "".dup.force_encoding('iso-2022-jp')).should == true
end
end
of PAC/BTI in Context.S works. Rather than appending the autodetected option to ASFLAGS, we simply compile a set of test programs with the actual CFLAGS in use to determine what PAC/BTI settings were actually chosen by the builder. Context.S is made aware of these choices through some custom macros. The result of this work is that: * Ruby will continue to choose some sensible defaults for hardening options for the C compiler * Distributors are able to specify CFLAGS that are consistent with their distribution and override these defaults * Context.S will react to whatever -mbranch-protection is actually in use, not what was autodetected * Extensions get built with hardening flags too. [Bug #20154] [Bug #20520] 2024-03-05[DOC] fix some commentscui fliter Signed-off-by: cui fliter <imcusg@gmail.com> 2024-02-06Use `__asm` instead of `asm`Nobuyoshi Nakada With `--std=c99` option coroutine/arm64/Context.h errs: ``` In file included from cont.c:26: coroutine/arm64/Context.h:59:5: error: call to undeclared function 'asm'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 59 | asm ("hint #8;" : "+r"(r17) : "r"(r16)); | ^ ``` Also move the common function header. 2023-12-22coroutine/arm64: Skip saving/restoring x30 twice and use `autiasp`Yuta Saito We don't need to save/restore x30 twice, and we can just use `ret`, which uses x30 as return address register instead of explicit `ret <reg>` instruction. This also allows us to use `autiasp` instead of `autia1716` and we can skip setting SP/LR to x16/x17. Also the size of register save area is shrunk by 16 bytes due to the removal of extra x30 save/restore. 2023-12-22coroutine/arm64/Context.S: Append PAC/BTI note section if neededYuta Saito Fixes https://bugs.ruby-lang.org/issues/20029 2023-12-22coroutine/arm64/Context.S: Insert `bti c` as BTI landing padYuta Saito 2023-12-22coroutine/arm64: Sign return address if PAC enabledYuta Saito 2022-05-25Add support for address sanitizer for amd64 and arm64.Samuel Williams Notes: Merged: https://github.com/ruby/ruby/pull/5926 2021-07-01Replace copy coroutine with pthread implementation.Samuel Williams 2021-04-01coroutine: Darwin on ARM64 needs alignment of 2^2David CARLIER 2021-03-22coroutine mac m1 update.David CARLIER using proper link register and frame pointer which equal x30/x29. Notes: Merged: https://github.com/ruby/ruby/pull/4243 2021-03-05coroutine arm64 generating note.GNU-stack section for linux.David Carlier Notes: Merged: https://github.com/ruby/ruby/pull/4238 2021-01-22Added include guards to coroutine headersNobuyoshi Nakada 2020-07-05Prefix export symbol prefix to coroutine_transferNobuyoshi Nakada 2020-07-05Removed trailing spaces [ci skip]Nobuyoshi Nakada 2019-12-28Remove "All Rights Reserved." from Copyright statement.Samuel Williams 2019-12-26decouple internal.h headers卜部昌平 Saves comitters' daily life by avoid #include-ing everything from internal.h to make each file do so instead. This would significantly speed up incremental builds. We take the following inclusion order in this changeset: 1. "ruby/config.h", where _GNU_SOURCE is defined (must be the very first thing among everything). 2. RUBY_EXTCONF_H if any. 3. Standard C headers, sorted alphabetically. 4. Other system headers, maybe guarded by #ifdef 5. Everything else, sorted alphabetically. Exceptions are those win32-related headers, which tend not be self- containing (headers have inclusion order dependencies). Notes: Merged: https://github.com/ruby/ruby/pull/2711 2019-06-26Add `ucontext` coroutine implementation for generic fallback.Samuel Williams 2019-05-16Make COROUTINE_REGISTERS compile-time only not to be a global symbolNobuyoshi Nakada 2018-11-24Change Makefile rule for assembly to use .S rather than .ssamuel It is more conventional to use compiler to pre-process and assemble the `.S` file rather than forcing Makefile to use `.s`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e 2018-11-20Fix indentation.samuel git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e 2018-11-20Prefer "static inline" to avoid duplicate symbols.samuel git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e 2018-11-20Formatting changes.samuel git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65857 b2dd03c8-39d4-4d8f-98ff-823fe69b080e 2018-11-20Ensure start function has correct declaration.samuel git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65856 b2dd03c8-39d4-4d8f-98ff-823fe69b080e 2018-11-20Mark COROUTINE as noreturn.samuel git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65853 b2dd03c8-39d4-4d8f-98ff-823fe69b080e 2018-11-20Tidy up comments.samuel git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65850 b2dd03c8-39d4-4d8f-98ff-823fe69b080e 2018-11-20Native implementation of coroutines to improve performance of fiberssamuel git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65834 b2dd03c8-39d4-4d8f-98ff-823fe69b080e