Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@ jobs:
- "3.2"
- "3.3"
- "3.4"
- "4.0"
- "head"

runs-on: ${{ matrix.os }}
env:
BUNDLE_WITHOUT: development
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7

- name: Setup
uses: ruby/setup-ruby@v1
Expand All @@ -28,15 +31,15 @@ jobs:

- name: Install dependencies
run: |
bundle install --jobs 4 --without development
bundle install --jobs 4

- name: Quickdraw Tests
run: bundle exec qt -t 1
run: bundle exec qt

rubocop:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7

- name: Setup
uses: ruby/setup-ruby@v1
Expand Down
2 changes: 1 addition & 1 deletion lib/refract/formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Formatter < BasicVisitor
#{IDENTIFIER}[?!=]?
| @@?#{IDENTIFIER}
| \$(?:#{IDENTIFIER}|-\w|\d+|[~*$?!@/\\;,.=:<>"&`'+])
| \[\]=? | [+\-]@? | [~!] | \*\*? | [/%&|^`] | <=> | ===? | =~ | !~ | != | <[<=]? | >[>=]?
| \[\]=? | [+-]@? | [~!] | \*\*? | [/%&|^`] | <=> | ===? | =~ | !~ | != | <[<=]? | >[>=]?
)\z
}x

Expand Down
2 changes: 1 addition & 1 deletion refract.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
spec.files = Dir[
"README.md",
"LICENSE.txt",
"lib/**/*.rb"
"lib/**/*.rb",
]

spec.require_paths = ["lib"]
Expand Down
24 changes: 13 additions & 11 deletions test/corpus.test.rb
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
# frozen_string_literal: true

# Slow: round trips every Ruby file in the standard library and installed
# gems. Run with `CORPUS=1 bundle exec qt test/corpus.test.rb`. Set CORPUS to
# a path fragment (e.g. `CORPUS=rubygems`) to only check matching files.
if ENV["CORPUS"]
require_relative "support/corpus"
class CorpusTest < Quickdraw::Test
# Slow: round trips every Ruby file in the standard library and installed
# gems. Run with `CORPUS=1 bundle exec qt test/corpus.test.rb`. Set CORPUS to
# a path fragment (e.g. `CORPUS=rubygems`) to only check matching files.
if ENV["CORPUS"]
require_relative "support/corpus"

test "round trips preserve the meaning of the corpus" do
files = Corpus.files
files = files.select { |path| path.include?(ENV["CORPUS"]) } unless ENV["CORPUS"] == "1"
test "round trips preserve the meaning of the corpus" do
files = Corpus.files
files = files.select { |path| path.include?(ENV["CORPUS"]) } unless ENV["CORPUS"] == "1"

failures = files.filter_map { |path| Corpus.check(path) }
failures = files.filter_map { |path| Corpus.check(path) }

assert(failures.empty?) do
"#{failures.length} of #{files.length} files changed meaning:\n#{Corpus.report(failures)}"
assert(failures.empty?) do
"#{failures.length} of #{files.length} files changed meaning:\n#{Corpus.report(failures)}"
end
end
end
end
Loading
Loading