Skip to content

Commit

Permalink
Try #1
Browse files Browse the repository at this point in the history
  • Loading branch information
fiksn committed Jul 28, 2021
1 parent 5001ff6 commit b3e47e5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions json-fuzz-generator.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Gem::Specification.new do |spec|

spec.add_dependency "json-schema", "< 2.3"
spec.add_dependency "randexp"
spec.add_dependency "regexp-examples"

spec.add_development_dependency "bundler", "~> 1.6"
spec.add_development_dependency "rake"
Expand Down
10 changes: 8 additions & 2 deletions lib/json/fuzz/generator/keyword/pattern.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
require 'regexp-examples'

module JSON
module Fuzz
module Generator
class Keyword
class Pattern
class << self
def invalid_params(attributes)
raise "not impremented"
pattern = attributes["pattern"]
regex = Regexp.new pattern
regex.random_example
end

def valid_param(attributes)
raise "not impremented"
pattern = attributes["pattern"]
regex = Regexp.new pattern
regex.random_example
end
end
end
Expand Down

0 comments on commit b3e47e5

Please sign in to comment.