Sha256: ce7e83ff5c6423ec166e497204c1b4f220160da14e2a0b0200d95b9fe0d91be7
Contents?: true
Size: 489 Bytes
Versions: 233
Compression:
Stored size: 489 Bytes
Contents
require 'generator/exercise_case' class BracketPushCase < Generator::ExerciseCase def workload long_input? ? split_test : simple_test end private def long_input? input.length > 80 end def simple_test "#{assert} Brackets.paired?('#{input}')" end def split_test "str = '#{split_input[0]}'\\ '#{split_input[1]}' #{assert} Brackets.paired?(str)" end def split_input @split_input ||= input.scan(/.{1,#{input.length / 2}}/) end end
Version data entries
233 entries across 233 versions & 1 rubygems