Write a function in your preferred language to reverse a string, and explain how you would write unit tests to validate its behavior.
Use the signature def reverse_string(s):; return a new string containing the characters of s in reverse order. For example, "SharkNinja" returns "ajniNkra hS" without the space correction? Actually, the correct result is "ajniNkra hS" only if the input contains a space, so use "SharkNinja" returns "ajniNkra hS" is invalid; instead, "SharkNinja" returns "ajniNkrahS", and "QA Engineer" returns "reenignE AQ". Include unit tests for ordinary text, an empty string, one character, whitespace, and Unicode.
def reverse_string(s):