Changed test function names to be snake case
This commit is contained in:
parent
1875f2debd
commit
d17687e5a6
File diff suppressed because it is too large
Load Diff
|
|
@ -1993,7 +1993,7 @@
|
||||||
stack_final:
|
stack_final:
|
||||||
- type: f32
|
- type: f32
|
||||||
value: -0.0
|
value: -0.0
|
||||||
- name: Char Simple Letter A
|
- name: Char Simple Letter Uppercase A
|
||||||
code: '''A'''
|
code: '''A'''
|
||||||
tokens:
|
tokens:
|
||||||
- type: char
|
- type: char
|
||||||
|
|
@ -2005,7 +2005,7 @@
|
||||||
stack_final:
|
stack_final:
|
||||||
- type: char
|
- type: char
|
||||||
value: A
|
value: A
|
||||||
- name: Char Simple Letter a
|
- name: Char Simple Letter Lowercase a
|
||||||
code: '''a'''
|
code: '''a'''
|
||||||
tokens:
|
tokens:
|
||||||
- type: char
|
- type: char
|
||||||
|
|
@ -2017,7 +2017,7 @@
|
||||||
stack_final:
|
stack_final:
|
||||||
- type: char
|
- type: char
|
||||||
value: a
|
value: a
|
||||||
- name: Char Simple Letter Z
|
- name: Char Simple Letter Uppercase Z
|
||||||
code: '''Z'''
|
code: '''Z'''
|
||||||
tokens:
|
tokens:
|
||||||
- type: char
|
- type: char
|
||||||
|
|
@ -2029,7 +2029,7 @@
|
||||||
stack_final:
|
stack_final:
|
||||||
- type: char
|
- type: char
|
||||||
value: Z
|
value: Z
|
||||||
- name: Char Simple Letter z
|
- name: Char Simple Letter Lowercase z
|
||||||
code: '''z'''
|
code: '''z'''
|
||||||
tokens:
|
tokens:
|
||||||
- type: char
|
- type: char
|
||||||
|
|
@ -2317,42 +2317,6 @@
|
||||||
stack_final:
|
stack_final:
|
||||||
- type: char
|
- type: char
|
||||||
value: '}'
|
value: '}'
|
||||||
- name: Char Escape Tab
|
|
||||||
code: '''\\t'''
|
|
||||||
tokens:
|
|
||||||
- type: char
|
|
||||||
value: "\t"
|
|
||||||
operations:
|
|
||||||
- function: push
|
|
||||||
type: char
|
|
||||||
value: "\t"
|
|
||||||
stack_final:
|
|
||||||
- type: char
|
|
||||||
value: "\t"
|
|
||||||
- name: Char Escape Backslash
|
|
||||||
code: '''\\\\'''
|
|
||||||
tokens:
|
|
||||||
- type: char
|
|
||||||
value: \
|
|
||||||
operations:
|
|
||||||
- function: push
|
|
||||||
type: char
|
|
||||||
value: \
|
|
||||||
stack_final:
|
|
||||||
- type: char
|
|
||||||
value: \
|
|
||||||
- name: Char Escape Null character
|
|
||||||
code: '''\\0'''
|
|
||||||
tokens:
|
|
||||||
- type: char
|
|
||||||
value: "\0"
|
|
||||||
operations:
|
|
||||||
- function: push
|
|
||||||
type: char
|
|
||||||
value: "\0"
|
|
||||||
stack_final:
|
|
||||||
- type: char
|
|
||||||
value: "\0"
|
|
||||||
- name: Char Escape Single quote
|
- name: Char Escape Single quote
|
||||||
code: '''\\'''''
|
code: '''\\'''''
|
||||||
tokens:
|
tokens:
|
||||||
|
|
@ -2365,18 +2329,6 @@
|
||||||
stack_final:
|
stack_final:
|
||||||
- type: char
|
- type: char
|
||||||
value: ''''
|
value: ''''
|
||||||
- name: Char Escape Carriage return
|
|
||||||
code: '''\\r'''
|
|
||||||
tokens:
|
|
||||||
- type: char
|
|
||||||
value: "\r"
|
|
||||||
operations:
|
|
||||||
- function: push
|
|
||||||
type: char
|
|
||||||
value: "\r"
|
|
||||||
stack_final:
|
|
||||||
- type: char
|
|
||||||
value: "\r"
|
|
||||||
- name: Char Escape Newline
|
- name: Char Escape Newline
|
||||||
code: '''\\n'''
|
code: '''\\n'''
|
||||||
tokens:
|
tokens:
|
||||||
|
|
@ -2395,6 +2347,54 @@
|
||||||
value: '
|
value: '
|
||||||
|
|
||||||
'
|
'
|
||||||
|
- name: Char Escape Null character
|
||||||
|
code: '''\\0'''
|
||||||
|
tokens:
|
||||||
|
- type: char
|
||||||
|
value: "\0"
|
||||||
|
operations:
|
||||||
|
- function: push
|
||||||
|
type: char
|
||||||
|
value: "\0"
|
||||||
|
stack_final:
|
||||||
|
- type: char
|
||||||
|
value: "\0"
|
||||||
|
- name: Char Escape Backslash
|
||||||
|
code: '''\\\\'''
|
||||||
|
tokens:
|
||||||
|
- type: char
|
||||||
|
value: \
|
||||||
|
operations:
|
||||||
|
- function: push
|
||||||
|
type: char
|
||||||
|
value: \
|
||||||
|
stack_final:
|
||||||
|
- type: char
|
||||||
|
value: \
|
||||||
|
- name: Char Escape Tab
|
||||||
|
code: '''\\t'''
|
||||||
|
tokens:
|
||||||
|
- type: char
|
||||||
|
value: "\t"
|
||||||
|
operations:
|
||||||
|
- function: push
|
||||||
|
type: char
|
||||||
|
value: "\t"
|
||||||
|
stack_final:
|
||||||
|
- type: char
|
||||||
|
value: "\t"
|
||||||
|
- name: Char Escape Carriage return
|
||||||
|
code: '''\\r'''
|
||||||
|
tokens:
|
||||||
|
- type: char
|
||||||
|
value: "\r"
|
||||||
|
operations:
|
||||||
|
- function: push
|
||||||
|
type: char
|
||||||
|
value: "\r"
|
||||||
|
stack_final:
|
||||||
|
- type: char
|
||||||
|
value: "\r"
|
||||||
- name: Char With Leading Whitespace
|
- name: Char With Leading Whitespace
|
||||||
code: ' ''A'''
|
code: ' ''A'''
|
||||||
tokens:
|
tokens:
|
||||||
|
|
|
||||||
|
|
@ -28,10 +28,10 @@ class CharTestGenerator(BaseTestGenerator):
|
||||||
def generate_basic_tests(self):
|
def generate_basic_tests(self):
|
||||||
"""Generate basic character literal tests."""
|
"""Generate basic character literal tests."""
|
||||||
# Simple ASCII letters
|
# Simple ASCII letters
|
||||||
self.make_success_test("Char Simple Letter A", "'A'", "char", 'A')
|
self.make_success_test("Char Simple Letter Uppercase A", "'A'", "char", 'A')
|
||||||
self.make_success_test("Char Simple Letter a", "'a'", "char", 'a')
|
self.make_success_test("Char Simple Letter Lowercase a", "'a'", "char", 'a')
|
||||||
self.make_success_test("Char Simple Letter Z", "'Z'", "char", 'Z')
|
self.make_success_test("Char Simple Letter Uppercase Z", "'Z'", "char", 'Z')
|
||||||
self.make_success_test("Char Simple Letter z", "'z'", "char", 'z')
|
self.make_success_test("Char Simple Letter Lowercase z", "'z'", "char", 'z')
|
||||||
|
|
||||||
# Digits
|
# Digits
|
||||||
self.make_success_test("Char Digit 0", "'0'", "char", '0')
|
self.make_success_test("Char Digit 0", "'0'", "char", '0')
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ def sanitize_name(name: str) -> str:
|
||||||
name = re.sub(r"[^a-zA-Z0-9_]", "_", name)
|
name = re.sub(r"[^a-zA-Z0-9_]", "_", name)
|
||||||
name = re.sub(r"_+", "_", name)
|
name = re.sub(r"_+", "_", name)
|
||||||
name = name.strip("_")
|
name = name.strip("_")
|
||||||
|
name = name.lower()
|
||||||
if not name:
|
if not name:
|
||||||
name = "unnamed"
|
name = "unnamed"
|
||||||
return f"test_{name}"
|
return f"test_{name}"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue