Fix inaccurate closing tag closing bug

This commit is contained in:
JeremyStar™ 2023-07-07 21:25:04 +02:00
parent 52892d4e35
commit 24fb70ce80

View file

@ -105,27 +105,27 @@ func do_tests(ignore_flag:bool = false) -> void:
tests_success = tests_success+1
tests_log = tests_log + "Y Test UPPERCASE returned \"" + tests_uppercase_result + "\".\n"
else:
tests_log = tests_log + "N Test UPPERCASE returned \"" + tests_uppercase_result + "\" instead of \"\n" + tests_uppercase + "\".\n"
tests_log = tests_log + "N Test UPPERCASE returned \"" + tests_uppercase_result + "\" instead of \"" + tests_uppercase + "\".\n"
if tests_lowercase_result == tests_lowercase:
tests_success = tests_success+1
tests_log = tests_log + "Y Test LOWERCASE returned \"" + tests_lowercase_result + "\".\n"
else:
tests_log = tests_log + "N Test LOWERCASE returned \"" + tests_lowercase_result + "\" instead of \"\n" + tests_lowercase + "\".\n"
tests_log = tests_log + "N Test LOWERCASE returned \"" + tests_lowercase_result + "\" instead of \"" + tests_lowercase + "\".\n"
if tests_camelcase_result == tests_camelcase:
tests_success = tests_success+1
tests_log = tests_log + "Y Test CAMELCASE returned \"" + tests_camelcase_result + "\".\n"
else:
tests_log = tests_log + "N Test CAMELCASE returned \"" + tests_camelcase_result + "\" instead of \"\n" + tests_camelcase + "\".\n"
tests_log = tests_log + "N Test CAMELCASE returned \"" + tests_camelcase_result + "\" instead of \"" + tests_camelcase + "\".\n"
if tests_pascalcase_result == tests_pascalcase:
tests_success = tests_success+1
tests_log = tests_log + "Y Test PASCALCASE returned \"" + tests_pascalcase_result + "\".\n"
else:
tests_log = tests_log + "N Test PASCALCASE returned \"" + tests_pascalcase_result + "\" instead of \"\n" + tests_pascalcase + "\".\n"
tests_log = tests_log + "N Test PASCALCASE returned \"" + tests_pascalcase_result + "\" instead of \"" + tests_pascalcase + "\".\n"
if tests_snakecase_result == tests_snakecase:
tests_success = tests_success+1
tests_log = tests_log + "Y Test SNAKECASE returned \"" + tests_snakecase_result + "\".\n"
else:
tests_log = tests_log + "N Test SNAKECASE returned \"" + tests_snakecase_result + "\" instead of \"\n" + tests_snakecase + "\".\n"
tests_log = tests_log + "N Test SNAKECASE returned \"" + tests_snakecase_result + "\" instead of \"" + tests_snakecase + "\".\n"
if tests_escapes_newlines_result == tests_escapes_newlines:
tests_success = tests_success+1
tests_log = tests_log + "Y Test ESCAPES_NEWLINES returned \"" + tests_escapes_newlines_result + "\".\n"
@ -191,9 +191,10 @@ func _case_lower(msg:String) -> String:
var msg_proc = msg
while true:
var index_one = msg_proc.find("<lo>")
var index_two = msg_proc.find("</lo>") + 3
var index_two = msg_proc.find("</lo>")
if index_one != -1:
if index_two != -1:
index_two = index_two + 5 - index_one
var index_proc = msg_proc.substr(index_one,index_two)
msg_proc = msg_proc.replace(index_proc,index_proc.replace("<lo>","").replace("</lo>","").to_lower())
else:
@ -214,9 +215,10 @@ func _case_upper(msg:String) -> String:
var msg_proc = msg
while true:
var index_one = msg_proc.find("<up>")
var index_two = msg_proc.find("</up>") + 3
var index_two = msg_proc.find("</up>")
if index_one != -1:
if index_two != -1:
index_two = index_two + 5 - index_one
var index_proc = msg_proc.substr(index_one,index_two)
msg_proc = msg_proc.replace(index_proc,index_proc.replace("<up>","").replace("</up>","").to_upper())
else:
@ -237,9 +239,10 @@ func _case_camelcase(msg:String) -> String:
var msg_proc = msg
while true:
var index_one = msg_proc.find("<ca>")
var index_two = msg_proc.find("</ca>") + 3
var index_two = msg_proc.find("</ca>")
if index_one != -1:
if index_two != -1:
index_two = index_two + 5 - index_one
var index_proc = msg_proc.substr(index_one,index_two)
msg_proc = msg_proc.replace(index_proc,index_proc.replace("<ca>","").replace("</ca>","").to_camel_case())
else:
@ -260,9 +263,10 @@ func _case_pascalcase(msg:String) -> String:
var msg_proc = msg
while true:
var index_one = msg_proc.find("<pa>")
var index_two = msg_proc.find("</pa>") + 3
var index_two = msg_proc.find("</pa>")
if index_one != -1:
if index_two != -1:
index_two = index_two + 5 - index_one
var index_proc = msg_proc.substr(index_one,index_two)
msg_proc = msg_proc.replace(index_proc,index_proc.replace("<pa>","").replace("</pa>","").to_pascal_case())
else:
@ -283,9 +287,10 @@ func _case_snakecase(msg:String) -> String:
var msg_proc = msg
while true:
var index_one = msg_proc.find("<sn>")
var index_two = msg_proc.find("</sn>") + 3
var index_two = msg_proc.find("</sn>")
if index_one != -1:
if index_two != -1:
index_two = index_two + 5 - index_one
var index_proc = msg_proc.substr(index_one,index_two)
msg_proc = msg_proc.replace(index_proc,index_proc.replace("<sn>","").replace("</sn>","").to_snake_case())
else: