-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6f2761c
commit d883dde
Showing
2 changed files
with
56 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# frozen_string_literal: true | ||
|
||
RSpec.describe RuPkl::Parser do | ||
let(:parser) do | ||
RuPkl::Parser.new | ||
end | ||
|
||
describe 'comment' do | ||
it 'should be ignored' do | ||
pkl = <<~'PKL'.chomp | ||
x = 10 // end-of-line comment | ||
y = 20 /* | ||
multi | ||
line | ||
/* nested */ | ||
comment | ||
*/ z = 30 | ||
/// documentation comment | ||
a = 40 | ||
b = 50 // single-line comment running until EOF rather than newline | ||
PKL | ||
|
||
expect(parser) | ||
.to parse_string(pkl, :pkl_module) | ||
.as(pkl_module do |m| | ||
m.property :x, 10 | ||
m.property :y, 20 | ||
m.property :z, 30 | ||
m.property :a, 40 | ||
m.property :b, 50 | ||
end) | ||
end | ||
end | ||
end |