Package lepl :: Package regexp :: Package _test :: Module random
[hide private]
[frames] | no frames]

Module random

source code

Tests for the lepl.regexp package. We generate random expressions and test the results against the python regexp matcher.
Classes [hide private]
  RandomTest
Functions [hide private]
 
randbool(weight=1) source code
 
random_expression(depth_left, alphabet)
Generate an expression.
source code
 
random_sequence(depth_left, alphabet) source code
 
random_option(depth_left, alphabet) source code
 
random_repeat(depth_left, alphabet) source code
 
random_choice(depth_left, alphabet) source code
 
random_range(_depth_left, alphabet) source code
 
random_string(depth_left, alphabet) source code
Function Details [hide private]

random_expression(depth_left, alphabet)

source code 
Generate an expression. If depth_left is 0 then the result must be a simple character; other levels build on this. Alphabet is a list of possible regular characters.