Enable REGEXP by connecting Crystal's stdlib Regex (#62)

This commit is contained in:
Ryan Westlund 2020-11-11 13:00:40 -05:00 committed by GitHub
parent 4abea0d326
commit 55b8399d7e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 0 deletions

View file

@ -128,4 +128,9 @@ DB::DriverSpecs(DB::Any).run do
it "handles multi-step pragma statements" do |db|
db.exec %(PRAGMA journal_mode = memory)
end
it "handles REGEXP operator" do |db|
(db.scalar "select 'unmatching text' REGEXP '^m'").should eq 0
(db.scalar "select 'matching text' REGEXP '^m'").should eq 1
end
end