Skip to content

Commit cdbedd1

Browse files
committed
Fix function names
1 parent 8a61e65 commit cdbedd1

File tree

1 file changed

+29
-29
lines changed

1 file changed

+29
-29
lines changed

qcheck_viewer/src/qcheck_viewer.gleam

+29-29
Original file line numberDiff line numberDiff line change
@@ -135,21 +135,21 @@ fn qcheck_function_to_html_option(
135135

136136
pub fn qcheck_function_to_string(qcheck_function: QcheckFunction) -> String {
137137
case qcheck_function {
138-
IntUniform -> "int_uniform"
139-
IntUniformInclusive -> "int_uniform_inclusive"
140-
IntSmallStrictlyPositive -> "int_small_strictly_positive"
141-
IntSmallPositiveOrZero -> "int_small_positive_or_zero"
138+
IntUniform -> "uniform_int"
139+
IntUniformInclusive -> "bounded_int"
140+
IntSmallStrictlyPositive -> "small_strictly_positive_int"
141+
IntSmallPositiveOrZero -> "small_non_negative_int"
142142
Float -> "float"
143-
FloatUniformInclusive -> "float_uniform_inclusive"
144-
CharUniformInclusive -> "char_uniform_inclusive"
145-
CharUppercase -> "char_uppercase"
146-
CharLowercase -> "char_lowercase"
147-
CharDigit -> "char_digit"
148-
CharPrintableUniform -> "char_printable_uniform"
149-
CharAlpha -> "char_alpha"
150-
CharAlphaNumeric -> "char_alpha_numeric"
151-
CharWhitespace -> "char_whitespace"
152-
CharPrintable -> "char_printable"
143+
FloatUniformInclusive -> "bounded_float"
144+
CharUniformInclusive -> "bounded_codepoint"
145+
CharUppercase -> "uppercase_ascii_codepoint"
146+
CharLowercase -> "lowercase_ascii_codepoint"
147+
CharDigit -> "ascii_digit_codepoint"
148+
CharPrintableUniform -> "uniform_printable_ascii_codepoint"
149+
CharAlpha -> "alphabetic_ascii_codepoint"
150+
CharAlphaNumeric -> "alphanumeric_ascii_codepoint"
151+
CharWhitespace -> "ascii_whitespace_codepoint"
152+
CharPrintable -> "printable_ascii_codepoint"
153153
}
154154
}
155155

@@ -163,21 +163,21 @@ fn qcheck_function_from_string(
163163
function_name: String,
164164
) -> Result(QcheckFunction, String) {
165165
case function_name {
166-
"int_uniform" -> Ok(IntUniform)
167-
"int_uniform_inclusive" -> Ok(IntUniformInclusive)
168-
"int_small_positive_or_zero" -> Ok(IntSmallPositiveOrZero)
169-
"int_small_strictly_positive" -> Ok(IntSmallStrictlyPositive)
166+
"uniform_int" -> Ok(IntUniform)
167+
"bounded_int" -> Ok(IntUniformInclusive)
168+
"small_strictly_positive_int" -> Ok(IntSmallPositiveOrZero)
169+
"small_non_negative_int" -> Ok(IntSmallStrictlyPositive)
170170
"float" -> Ok(Float)
171-
"float_uniform_inclusive" -> Ok(FloatUniformInclusive)
172-
"char_uniform_inclusive" -> Ok(CharUniformInclusive)
173-
"char_uppercase" -> Ok(CharUppercase)
174-
"char_lowercase" -> Ok(CharLowercase)
175-
"char_digit" -> Ok(CharDigit)
176-
"char_printable_uniform" -> Ok(CharPrintableUniform)
177-
"char_alpha" -> Ok(CharAlpha)
178-
"char_alpha_numeric" -> Ok(CharAlphaNumeric)
179-
"char_whitespace" -> Ok(CharWhitespace)
180-
"char_printable" -> Ok(CharPrintable)
171+
"bounded_float" -> Ok(FloatUniformInclusive)
172+
"bounded_codepoint" -> Ok(CharUniformInclusive)
173+
"uppercase_ascii_codepoint" -> Ok(CharUppercase)
174+
"lowercase_ascii_codepoint" -> Ok(CharLowercase)
175+
"ascii_digit_codepoint" -> Ok(CharDigit)
176+
"uniform_printable_ascii_codepoint" -> Ok(CharPrintableUniform)
177+
"alphabetic_ascii_codepoint" -> Ok(CharAlpha)
178+
"alphanumeric_ascii_codepoint" -> Ok(CharAlphaNumeric)
179+
"ascii_whitespace_codepoint" -> Ok(CharWhitespace)
180+
"printable_ascii_codepoint" -> Ok(CharPrintable)
181181
_ -> Error("bad function name")
182182
}
183183
}
@@ -320,7 +320,7 @@ fn maybe_show_error(error_message) {
320320
fn maybe_function_options(model: Model) {
321321
case model.function {
322322
// TODO: make a float input box for the float functions.
323-
IntUniformInclusive | FloatUniformInclusive -> {
323+
IntUniformInclusive | FloatUniformInclusive | CharUniformInclusive -> {
324324
html.div([], [
325325
html.label([], [
326326
html.text("High"),

0 commit comments

Comments
 (0)