Accept multiline block in an assertion (WIP) #23
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I'm trying to support assertions with multiple lines block. How about this?
#20 の元々の問題は、長くなった行を読みやすさのために折り返しているとpower_assertでパースしてもらえないという点でした。
これについて、アドホックなやり方での対応を試みてみました。どうでしょうか?
現時点ですぐにマージしていただける物とは考えておらず、ひとまずご意見を頂けましたら幸いです。
基本的な考え方は、「1行をパースして失敗したら、次の行を足してパースし直す。これをパースに成功するまで繰り返す。」というものです。
そのため、現状でのデメリットとして、今まで
valid_syntax?(str)
でfalse
と判定されていたケースで毎回ファイルの終端までの読み込みが行われてしまうため、テストの実行速度が低下することが懸念されます。この問題についての有効な解決策はまだ思いついておりません。