From d2642d04b967471359c4daa1e8df05616289507d Mon Sep 17 00:00:00 2001 From: Shumilov Petr Date: Tue, 9 Aug 2022 20:43:52 +0300 Subject: [PATCH 01/84] Add generator --- .../test/staticTS/formatChecker/generate.py | 128 ++++++++++++++++++ .../staticTS/formatChecker/requirements.txt | 3 + migrator/test/staticTS/formatChecker/setup.sh | 31 +++++ .../staticTS/formatChecker/utils/constants.py | 21 +++ .../formatChecker/utils/exceptions.py | 18 +++ .../formatChecker/utils/file_structure.py | 79 +++++++++++ .../staticTS/formatChecker/utils/fsutils.py | 23 ++++ .../formatChecker/utils/metainformation.py | 69 ++++++++++ .../staticTS/formatChecker/utils/test_case.py | 27 ++++ .../formatChecker/utils/test_parameters.py | 46 +++++++ 10 files changed, 445 insertions(+) create mode 100644 migrator/test/staticTS/formatChecker/generate.py create mode 100644 migrator/test/staticTS/formatChecker/requirements.txt create mode 100755 migrator/test/staticTS/formatChecker/setup.sh create mode 100644 migrator/test/staticTS/formatChecker/utils/constants.py create mode 100644 migrator/test/staticTS/formatChecker/utils/exceptions.py create mode 100644 migrator/test/staticTS/formatChecker/utils/file_structure.py create mode 100644 migrator/test/staticTS/formatChecker/utils/fsutils.py create mode 100644 migrator/test/staticTS/formatChecker/utils/metainformation.py create mode 100644 migrator/test/staticTS/formatChecker/utils/test_case.py create mode 100644 migrator/test/staticTS/formatChecker/utils/test_parameters.py diff --git a/migrator/test/staticTS/formatChecker/generate.py b/migrator/test/staticTS/formatChecker/generate.py new file mode 100644 index 000000000..3b3886cd7 --- /dev/null +++ b/migrator/test/staticTS/formatChecker/generate.py @@ -0,0 +1,128 @@ +import argparse +from email import message +import os +import os.path as ospath +from pathlib import Path +from re import T +from unittest import loader +from jinja2 import Environment, FileSystemLoader, select_autoescape, TemplateSyntaxError +from typing import List +from utils.file_structure import walk_test_subdirs +from utils.metainformation import InvalidMetaException, find_all_metas +from utils.fsutils import iter_files, write_file +from utils.constants import SKIP_PREFIX, VARIABLE_START_STRING, YAML_EXTENSIONS, TEMPLATE_EXTENSION, OUT_EXTENSION, LIST_PREFIX +from utils.exceptions import * +from utils.test_parameters import load_params + +# ============================================ +# Working with templates and their results + +env = Environment( + loader=FileSystemLoader("."), + autoescape=select_autoescape(), + variable_start_string=VARIABLE_START_STRING +) + +def render_template(filepath: str, params=dict()) -> str: + """ + Renders a single template and returns result as string + """ + try: + template = env.get_template(filepath) + return template.render(**params) + except TemplateSyntaxError as e: + raise InvalidFileFormatException(message=f"Tempate Syntax Error: ${e.message}", filepath=filepath) + except Exception as e: + raise UnknownTemplateException(filepath=filepath, exception=e) + + +def split_into_tests(text: str, filepath: str) -> List[str]: + """ + Splits rendered template into multiple tests. + 'filepath' is needed for exceptions + """ + result = [] + + try: + start_indices = [metainfile[0] for metainfile in find_all_metas(text)] + except InvalidMetaException as e: + raise InvalidFileFormatException(filepath=filepath, message=f"Error raised while splitting a rendered template: {e.message}") + + for i in range(1, len(start_indices)): + left = start_indices[i - 1] + right = start_indices[i] + result.append(text[left:right]) + result.append(text[start_indices[-1]:]) + + return result + + +# ============================================ +# Recursively walk the FS, save rendered templates + +def render_and_write_templates(dirpath, outpath): + """ + Loads parameters and renders all templates in `dirpath`. + Saves the results in `outpath` + """ + os.makedirs(outpath, exist_ok=True) + + params = load_params(dirpath) + for name, path in iter_files(dirpath, allowed_ext=[TEMPLATE_EXTENSION]): + name_without_ext, _ = ospath.splitext(name) + if name_without_ext.startswith(SKIP_PREFIX): + continue + tests = split_into_tests(render_template(path, params), path) + assert len(tests) > 0, "Internal error: there should be tetst" + if len(tests) == 1: + # if there is only one test we do not add any suffixes + write_file(path=ospath.join(outpath, name), text=tests[0]) + else: + # if there are multiple tests we add any suffixes: name_0.sts, name_1.sts and etc + for i, test in enumerate(tests): + output_filepath = ospath.join(outpath, f"{name_without_ext}_{i}{OUT_EXTENSION}") + write_file(path=output_filepath, text=test) + +def process_tests(root: Path, outpath: Path): + """ + Renders all templates and saves them. + """ + for dir in walk_test_subdirs(root): + dir_outpath = outpath / dir.path.relative_to(root) + render_and_write_templates(str(dir.path), str(dir_outpath)) + + +# ============================================ +# Entry + + +parser = argparse.ArgumentParser(description='Generate CTS tests from a set of templates.') +parser.add_argument('tests_dir', help='Path to directory that contains tests templates and parameters') +parser.add_argument('output_dir', help='Path to output directory. Output directory and all subdirectories are created automatically') + + +def main(): + args = parser.parse_args() + root = Path(args.tests_dir) + outpath = Path(args.output_dir) + + if not root.is_dir(): + print(f"ERROR: {str(root.absolute())} must be a directory") + exit(1) + + try: + process_tests(root, outpath) + except InvalidFileFormatException as e: + print("Error:\n", e.message) + exit(1) + except InvalidFileStructureException as e: + print("Error:\n", e.message) + exit(1) + except UnknownTemplateException as e: + print(f"{e.filepath}: exception while processing template:") + print("\t", repr(e.exception)) + exit(1) + print("Finished") + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/migrator/test/staticTS/formatChecker/requirements.txt b/migrator/test/staticTS/formatChecker/requirements.txt new file mode 100644 index 000000000..87d456b43 --- /dev/null +++ b/migrator/test/staticTS/formatChecker/requirements.txt @@ -0,0 +1,3 @@ +Jinja2==3.1.2 +MarkupSafe==2.1.1 +PyYAML==6.0 \ No newline at end of file diff --git a/migrator/test/staticTS/formatChecker/setup.sh b/migrator/test/staticTS/formatChecker/setup.sh new file mode 100755 index 000000000..845eb1fd3 --- /dev/null +++ b/migrator/test/staticTS/formatChecker/setup.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +# IMPORTANT!: Run this script from migrator/test/staticTS. NOT FROM formatChecker + +# This script installs all dependencies for formatChecker +# by creating a virtualenv + +# Checking Python version +function version { echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'; } + +MIN_PYTHON_VERSION="3.8.0" +CURRENT_PYTHON_VERSION=`python3 -c "import platform; print(platform. python_version())"` + +if [ $(version $CURRENT_PYTHON_VERSION) -lt $(version $MIN_PYTHON_VERSION) ]; then + echo "Python version must be greater than $MIN_PYTHON_VERSION" + exit +fi + +# Cheking venv existance +sudo apt install python3-venv -yyy + + +pushd formatChecker + +python3 -m venv .venv +source .venv/bin/activate + +python3 -m ensurepip --upgrade +python3 -m pip install -r requirements.txt + +popd \ No newline at end of file diff --git a/migrator/test/staticTS/formatChecker/utils/constants.py b/migrator/test/staticTS/formatChecker/utils/constants.py new file mode 100644 index 000000000..4afc98d27 --- /dev/null +++ b/migrator/test/staticTS/formatChecker/utils/constants.py @@ -0,0 +1,21 @@ +import re + +# Meta +META_START_STRING = "/*---" +META_START_PATTERN = re.compile("\/\*---") +META_END_STRING = "---*/" +META_END_PATTERN = re.compile("---\*\/") + +# Extensions +YAML_EXTENSIONS = [".yaml", ".yml"] +TEMPLATE_EXTENSION = ".sts" +OUT_EXTENSION = ".sts" +JAR_EXTENSION = ".jar" + +# Prefixes +LIST_PREFIX = "list." +NEGATIVE_PREFIX = "n." +SKIP_PREFIX = "tbd." + +# Jinja +VARIABLE_START_STRING = "{{." \ No newline at end of file diff --git a/migrator/test/staticTS/formatChecker/utils/exceptions.py b/migrator/test/staticTS/formatChecker/utils/exceptions.py new file mode 100644 index 000000000..a15a25f7d --- /dev/null +++ b/migrator/test/staticTS/formatChecker/utils/exceptions.py @@ -0,0 +1,18 @@ +class InvalidFileFormatException(Exception): + def __init__(self, filepath: str, message: str) -> None: + super().__init__(f"{filepath}: {message}") + self.message = f"{filepath}: {message}" + + +class InvalidFileStructureException(Exception): + def __init__(self, filepath: str, message: str) -> None: + msg = f"{filepath}: {message}" + super().__init__(msg) + self.message = msg + + +class UnknownTemplateException(Exception): + def __init__(self, filepath: str, exception: Exception) -> None: + super().__init__(f"{filepath}: {str(exception)}") + self.filepath = filepath + self.exception = exception \ No newline at end of file diff --git a/migrator/test/staticTS/formatChecker/utils/file_structure.py b/migrator/test/staticTS/formatChecker/utils/file_structure.py new file mode 100644 index 000000000..bbbbb0bf4 --- /dev/null +++ b/migrator/test/staticTS/formatChecker/utils/file_structure.py @@ -0,0 +1,79 @@ +# This file defines the CTS file structure +# The entrypoint is the function 'walk_test_subdirs' + +from dataclasses import dataclass +from pathlib import Path +from re import sub +from typing import Iterable, Tuple, List, Union +import os +import os.path as ospath + +from utils.exceptions import InvalidFileStructureException + + +@dataclass() +class TestDirectory: + parent: Union['TestDirectory', None] + path: Path + + cur_section_index: int + section_name: str + + def __init__(self, path: Path, parent: Union['TestDirectory', None] = None) -> None: + self.parent = parent + self.path = path + self.cur_section_index, self.section_name = parse_section_dir_name(path) + + def full_index(self) -> List[int]: + cur = self + result = [] + while (cur is not None): + result.append(cur.cur_section_index) + cur = cur.parent + return list(reversed(result)) + + def iter_files(self, allowed_ext: List[str] = []) -> Iterable[Path]: + for filename in os.listdir(str(self.path)): + filepath: Path = self.path / filename + if len(allowed_ext) > 0 and filepath.suffix not in allowed_ext: + continue + yield filepath + + def is_empty(self): + return len(os.listdir(str(self.path))) == 0 + + +def walk_test_subdirs(path: Path, parent=None) -> Iterable[TestDirectory]: + """ + Walks the file system from the CTS root, yielding TestDirectories, in correct order: + For example, if only directories 1, 1/1, 1/1/1, 1/1/2, 1/2 exist, they will be yielded in that order. + """ + subdirs = [] + for name in os.listdir(str(path)): + if (path / name).is_dir(): + subdirs.append(TestDirectory(parent=parent, path=(path / name))) + subdirs = sorted(subdirs, key=lambda dir: dir.cur_section_index) + + for subdir in subdirs: + yield subdir + # walk recursively + for subsubdir in walk_test_subdirs(subdir.path, subdir): + yield subsubdir + + +def parse_section_dir_name(path: Path) -> Tuple[int, str]: + parts = path.name.split(".") + if len(parts) == 1: + if not path.name.isdigit(): + raise InvalidFileStructureException(filepath=str(path), message="Invalid directory name format") + return int(path.name), "" + if len(parts) != 2: + raise InvalidFileStructureException(filepath=str(path), message="Invalid directory name format") + first, second = parts + if not first.isdigit(): + raise InvalidFileStructureException(filepath=str(path), message="Invalid directory name format") + if not second.islower() or ' ' in second: + raise InvalidFileStructureException(filepath=str(path), message="Section name must be lowercase and contain spaces") + return int(first), second + + diff --git a/migrator/test/staticTS/formatChecker/utils/fsutils.py b/migrator/test/staticTS/formatChecker/utils/fsutils.py new file mode 100644 index 000000000..ff90ec775 --- /dev/null +++ b/migrator/test/staticTS/formatChecker/utils/fsutils.py @@ -0,0 +1,23 @@ +# Util file system functions + +import os +import os.path as ospath +from typing import List + + +def iterdir(dirpath: str): + return((name, ospath.join(dirpath, name)) for name in os.listdir(dirpath)) + + +def iter_files(dirpath: str, allowed_ext: List[str]): + for name, path in iterdir(dirpath): + if not ospath.isfile(path): + continue + _, ext = ospath.splitext(path) + if ext in allowed_ext: + yield name, path + + +def write_file(path, text): + with open(path, "w+", encoding="utf8") as f: + f.write(text) \ No newline at end of file diff --git a/migrator/test/staticTS/formatChecker/utils/metainformation.py b/migrator/test/staticTS/formatChecker/utils/metainformation.py new file mode 100644 index 000000000..c186e376e --- /dev/null +++ b/migrator/test/staticTS/formatChecker/utils/metainformation.py @@ -0,0 +1,69 @@ +# This file defines the CTS test metadata format +# The entrypoint is the 'find_all_metas' function + +from typing import Tuple, List +import yaml +import re + +from utils.constants import META_END_PATTERN, META_END_STRING, META_START_PATTERN, META_START_STRING + + +ParsedMeta = dict +MetaInText = Tuple[int, int, ParsedMeta] + + +class InvalidMetaException(Exception): + def __init__(self, msg: str) -> None: + super().__init__() + self.message = msg + + +def find_all_metas(text: str) -> List[MetaInText]: + """ + Given a text of the whole test, this function: + 1) Find all metas in this text + 2) Parses each meta and verifies it's correctness + Returns a list of tuples (start: int, end: int, meta: ParsedMeta), + where 'start' and 'end' are indices in 'text' such that text[start:end] == "/*---" + strMeta + "---*/" + and 'meta' is the parsed meta + + Raised: InvalidMetaException + """ + result = [] + + start_indices = [m.start() for m in re.finditer(META_START_PATTERN, text)] + end_indices = [m.end() for m in re.finditer(META_END_PATTERN, text)] + + + if len(start_indices) != len(end_indices) or len(start_indices) == 0: + raise InvalidMetaException("Invalid meta or meta doesn't exist") + + meta_bounds = list(zip(start_indices, end_indices)) + + # verify meta bounds + for i in range(1, len(meta_bounds)): + prev_start, prev_end = meta_bounds[i - 1] + start, end = meta_bounds[i] + if not (prev_start < prev_end < start < end): + raise InvalidMetaException("Invalid meta") + + for start, end in meta_bounds: + meta = __parse_meta(text[start:end]) + result.append((start, end, meta)) + + return result + + +def __parse_meta(meta: str) -> dict: + """ + Given a meta, a string that starts with '/*---', ends with '---*/' and contains a valid YAML in between, + this function parses that meta and validating it. + """ + assert len(meta) > len(META_START_STRING) + len(META_END_STRING) + assert meta.startswith(META_START_STRING) and meta.endswith(META_END_STRING) + + yaml_string = meta[len(META_START_STRING):-len(META_END_STRING)] + try: + return yaml.load(yaml_string, Loader=yaml.Loader) + except Exception as e: + raise InvalidMetaException(str(e)) diff --git a/migrator/test/staticTS/formatChecker/utils/test_case.py b/migrator/test/staticTS/formatChecker/utils/test_case.py new file mode 100644 index 000000000..62a477938 --- /dev/null +++ b/migrator/test/staticTS/formatChecker/utils/test_case.py @@ -0,0 +1,27 @@ + +from pathlib import Path +from re import template +from typing import Tuple + +from utils.constants import NEGATIVE_PREFIX, SKIP_PREFIXES + + +def is_negative(path: Path) -> bool: + return path.name.startswith(NEGATIVE_PREFIX) + + +def should_be_skipped(path: Path) -> bool: + return path.name.startswith(SKIP_PREFIXES) + + +def strip_template(path: Path) -> Tuple[str, int]: + stem = path.stem + i = path.stem.rfind("_") + if i == -1: + return stem, 0 + template_name = stem[:i] + test_index = stem[i + 1:] + if not test_index.isdigit(): + return stem, 0 + else: + return template_name, int(test_index) \ No newline at end of file diff --git a/migrator/test/staticTS/formatChecker/utils/test_parameters.py b/migrator/test/staticTS/formatChecker/utils/test_parameters.py new file mode 100644 index 000000000..eb144e3b9 --- /dev/null +++ b/migrator/test/staticTS/formatChecker/utils/test_parameters.py @@ -0,0 +1,46 @@ +# This file provides functions thar are responsible for loading test parameters +# that are used in templates (yaml lists). + +import yaml +import os.path as ospath + +from utils.exceptions import InvalidFileFormatException +from utils.fsutils import iter_files +from utils.constants import YAML_EXTENSIONS, LIST_PREFIX + + +Params = dict + + +def load_params(dirpath: str) -> Params: + """ + Loads all parameters for a directory + """ + result = dict() + + for filename, filepath in iter_files(dirpath, allowed_ext=YAML_EXTENSIONS): + name_without_ext, _ = ospath.splitext(filename) + if not name_without_ext.startswith(LIST_PREFIX): + raise InvalidFileFormatException(message="Lists of parameters must start with 'list.'", filepath=filepath) + listname = name_without_ext[len(LIST_PREFIX):] + result[listname] = __parse_yaml_list(filepath) + return result + + +def __parse_yaml_list(path: str) -> Params: + """ + Parses a single YAML list of parameters + Verifies that it is a list + """ + # TODO: Move to fsutils + with open(path, "r", encoding='utf8') as f: + text = f.read() + + try: + params = yaml.load(text, Loader=yaml.FullLoader) + except Exception as e: + raise InvalidFileFormatException(message=f"Could not load YAML: {str(e)}", filepath=path) + + if type(params) != list: + raise InvalidFileFormatException(message="Parameters list must be YAML array", filepath=path) + return params \ No newline at end of file -- Gitee From 7a1d4574fcaadc61fddb8fdfeddb7047ce4b03ef Mon Sep 17 00:00:00 2001 From: Shumilov Petr Date: Wed, 10 Aug 2022 18:52:45 +0300 Subject: [PATCH 02/84] Add runner --- .../test/staticTS/formatChecker/run_tests.py | 152 ++++++++++++++++++ migrator/test/staticTS/formatChecker/setup.sh | 1 - 2 files changed, 152 insertions(+), 1 deletion(-) create mode 100644 migrator/test/staticTS/formatChecker/run_tests.py diff --git a/migrator/test/staticTS/formatChecker/run_tests.py b/migrator/test/staticTS/formatChecker/run_tests.py new file mode 100644 index 000000000..6850487ea --- /dev/null +++ b/migrator/test/staticTS/formatChecker/run_tests.py @@ -0,0 +1,152 @@ +from dataclasses import dataclass +from pathlib import Path +from utils.file_structure import walk_test_subdirs +from utils.metainformation import InvalidMetaException, find_all_metas +from utils.exceptions import InvalidFileFormatException, InvalidFileStructureException +from utils.constants import JAR_EXTENSION, TEMPLATE_EXTENSION, NEGATIVE_PREFIX +import subprocess +import argparse +import os.path as ospath +from typing import List + + +# ======================================================= +# Test diagnostics + + +def load_test_meta(testpath: Path) -> dict: + testpath = str(testpath) + # TODO: move to fsutils + with open(testpath, "r") as f: + test = f.read() + + try: + metas = find_all_metas(test) + except InvalidMetaException as e: + raise InvalidFileFormatException(filepath=testpath, message=f"ERROR: {str(e)}") + + if len(metas) == 0: + raise InvalidFileFormatException(filepath=testpath, message="No meta found in file") + elif len(metas) > 1: + raise InvalidFileFormatException(filepath=testpath, message="Multiple meta found in file") + else: + _, _, meta = metas[0] + return meta + + +def print_test_failure(filepath: Path): + print("\nFAIL:", filepath) + try: + meta = load_test_meta(filepath) + for key in meta.keys(): + print(f"\t{key}: {meta[key]}") + except InvalidFileFormatException as e: + print(f"\tERROR: Could not load test's meta: {str(e)}") + + +# ======================================================= +# Run tests + + +@dataclass +class RunStats: + """ + Test execution statistics + """ + failed: List[Path] + passed: List[Path] + + def __init__(self): + self.failed = [] + self.passed = [] + + def record_failure(self, path: Path): + self.failed.append(path) + + def record_success(self, path: Path): + self.passed.append(path) + +def test_should_pass(filepath: Path) -> bool: + return not filepath.name.startswith(NEGATIVE_PREFIX) + +def run_test(filepath: Path, runnerpath: Path) -> bool: + """ + Runs the tests and returns True if it passed. + Takes into account the test's type (positive or negative) + """ + # TODO: Make a separate entity describes process of running the test. + # TODO: Each instance or children (depends on design) have to the method 'run' with (status, message, payload) as result + code = subprocess.run( + ["java", "-jar", str(runnerpath), "-T", str(filepath)], + stderr=subprocess.DEVNULL, + stdout=subprocess.DEVNULL + ).returncode + + passed = (code == 0) + + return passed == test_should_pass(filepath) + + +def run_tests(root: Path, runnerpath: Path) -> bool: + """ + Runs all tests in a test-suite + """ + stats = RunStats() + + for dir in list(walk_test_subdirs(root)): + for filepath in dir.iter_files(): + if ospath.isdir(filepath): + continue + if run_test(filepath, runnerpath) == True: + stats.record_success(filepath) + else: + stats.record_failure(filepath) + print_test_failure(filepath) + + return stats + + +# ======================================================= +# Entry + + +parser = argparse.ArgumentParser(description='Run CTS tests.') +parser.add_argument('tests_dir', help='Path to directory that contains the tests') +parser.add_argument('runner_tool_path', help='Path to runner tool. Available runners: 1) migration tool, specify path to jar') + + +def main(): + args = parser.parse_args() + + testpath = Path(args.tests_dir) + runnerpath = Path(args.runner_tool_path) + + # Verify that CTS dir exists + if not testpath.is_dir(): + print(f"ERROR: Path '{testpath}' must be a directory") + exit(1) + + # Verify runner tool exists + path = Path.cwd() / runnerpath + if not path.is_file() or path.suffix != JAR_EXTENSION: + print(f"ERROR: Path '{runnerpath}' must point to a runner, e.g. migration tool") + exit(1) + + try: + stats = run_tests(testpath, runnerpath) + except (InvalidFileFormatException, InvalidFileStructureException) as e: + print("ERROR:\n", e.message) + exit(1) + + print("\n=====") + print(f"TESTS {len(stats.failed) + len(stats.passed)} | SUCCESS {len(stats.passed)} | FAILED {len(stats.failed)}\n") + + if len(stats.failed) > 0: + print("FAIL!") + exit(1) + else: + print("SUCCESS!") + + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/migrator/test/staticTS/formatChecker/setup.sh b/migrator/test/staticTS/formatChecker/setup.sh index 845eb1fd3..443adcba9 100755 --- a/migrator/test/staticTS/formatChecker/setup.sh +++ b/migrator/test/staticTS/formatChecker/setup.sh @@ -19,7 +19,6 @@ fi # Cheking venv existance sudo apt install python3-venv -yyy - pushd formatChecker python3 -m venv .venv -- Gitee From 7f1c705438ce85aa8e65ea93e7f79a46a59e111e Mon Sep 17 00:00:00 2001 From: Shumilov Petr Date: Thu, 11 Aug 2022 12:25:06 +0300 Subject: [PATCH 03/84] Enhance setup.sh --- migrator/test/staticTS/formatChecker/setup.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/migrator/test/staticTS/formatChecker/setup.sh b/migrator/test/staticTS/formatChecker/setup.sh index 443adcba9..0f8d3008d 100755 --- a/migrator/test/staticTS/formatChecker/setup.sh +++ b/migrator/test/staticTS/formatChecker/setup.sh @@ -1,6 +1,7 @@ #!/bin/bash -# IMPORTANT!: Run this script from migrator/test/staticTS. NOT FROM formatChecker +SCRIPT=`readlink -e $BASH_SOURCE` +SCRIPT_DIR=`dirname $SCRIPT` # This script installs all dependencies for formatChecker # by creating a virtualenv @@ -19,7 +20,7 @@ fi # Cheking venv existance sudo apt install python3-venv -yyy -pushd formatChecker +pushd $SCRIPT_DIR/../formatChecker python3 -m venv .venv source .venv/bin/activate @@ -27,4 +28,4 @@ source .venv/bin/activate python3 -m ensurepip --upgrade python3 -m pip install -r requirements.txt -popd \ No newline at end of file +popd \ No newline at end of file -- Gitee From 77dc7cdf3641c8a4b59de626d6369b65782b47b5 Mon Sep 17 00:00:00 2001 From: Shumilov Petr Date: Thu, 11 Aug 2022 13:00:22 +0300 Subject: [PATCH 04/84] Add coverage --- .../test/staticTS/formatChecker/coverage.py | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 migrator/test/staticTS/formatChecker/coverage.py diff --git a/migrator/test/staticTS/formatChecker/coverage.py b/migrator/test/staticTS/formatChecker/coverage.py new file mode 100644 index 000000000..27cf66334 --- /dev/null +++ b/migrator/test/staticTS/formatChecker/coverage.py @@ -0,0 +1,70 @@ +from pathlib import Path +import argparse + +from utils.constants import TEMPLATE_EXTENSION +from utils.test_case import is_negative, strip_template +from utils.file_structure import TestDirectory, walk_test_subdirs + + +def count_tests(dir: TestDirectory): + pos_tests = 0 + neg_tests = 0 + templates = set() + + for testfile in dir.iter_files(allowed_ext=[TEMPLATE_EXTENSION]): + if is_negative(testfile): + neg_tests += 1 + else: + pos_tests += 1 + template_name, _ = strip_template(testfile) + templates.add(template_name) + return pos_tests, neg_tests, len(templates) + + +def coverage(testpath: Path): + total_templates = 0 + total_positive_tests = 0 + total_negative_tests = 0 + + print("Coverage:\n") + for dir in walk_test_subdirs(testpath): + full_index = dir.full_index() + depth = len(full_index) + assert depth >= 1 + # Count + pos_tests, neg_tests, n_templates = count_tests(dir) + # Save + total_positive_tests += pos_tests + total_negative_tests += neg_tests + total_templates += n_templates + # Print + left_space = " " * 2 * depth + section_index = ".".join([str(i) for i in full_index]) + section_name = dir.section_name.replace("_", " ").title() + right_space = 90 - len(left_space) - len(section_index) - len(section_name) + if not dir.is_empty(): + print(left_space, section_index, section_name, "." * right_space, f"templates: {n_templates}; tests: {pos_tests} pos, {neg_tests} neg.\n") + + print("\n=====") + print(f"TOTAL TEMPLATES {total_templates} | TOTAL POSITIVE TESTS {total_positive_tests} | TOTAL NEGATIVE TESTS {total_negative_tests}") + + +parser = argparse.ArgumentParser(description='Run CTS tests.') +parser.add_argument('tests_dir', help='Path to directory that contains the tests.') + + +def main(): + args = parser.parse_args() + + testpath = Path(args.tests_dir) + + # Verify that CTS dir exists + if not testpath.is_dir(): + print(f"ERROR: Path '{testpath}' must point to a directory") + exit(1) + + coverage(testpath) + + +if __name__ == "__main__": + main() \ No newline at end of file -- Gitee From 65eeaeb92d34c69580a72c6539e36fe3fcb91cec Mon Sep 17 00:00:00 2001 From: Shumilov Petr Date: Thu, 11 Aug 2022 15:26:08 +0300 Subject: [PATCH 05/84] Add readme --- .../test/staticTS/formatChecker/README.md | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 migrator/test/staticTS/formatChecker/README.md diff --git a/migrator/test/staticTS/formatChecker/README.md b/migrator/test/staticTS/formatChecker/README.md new file mode 100644 index 000000000..864eefce2 --- /dev/null +++ b/migrator/test/staticTS/formatChecker/README.md @@ -0,0 +1,46 @@ +# STS CTS Format Checker + +> Stabilized format for writing tests and a proof of concept test generator uses that format + + +Tests in STS CTS should be generated to increase developer productivity. +Tests can be generated using the idea of templates and parameters: test developers define programs with placeholder spot (a.k.a. templates) and values which can be substituted in those spots (parameters). + +The test generator must define a certain format for writing templates and parameters. +In `Format Checker` we try to stabilize this format by implementing a Proof of Concept tool that eats test files in the specified format and generates ready-to-execute tests. + +## Getting Started + +1. Install all dependencies: `source formatChecker/setup.sh`; or activate venv if you have already executed the setup script: `source formatChecker/.venv/bin/activate` + +2. Generate CTS: `python3 formatChecker/generate.py CTS ./formatChecker/output` + +3. Build migration tool: at project root run `ant build` + +4. Run tests: `python3 formatChecker/run_tests.py ~/formatCheker/output /path/to/migration-tool.jar` + +5. Get coverage: `python3 formatChecker/coverage.py ./formatChecker/output` + +## File Structure + +TBD + +### File Naming Convention + +TBD + +## Format + +TBD + +### Test meta information + +TBD + +### Test file (template) format + +TBD + +### Parameter list file format + +TBD \ No newline at end of file -- Gitee From 73b76e79cb1209c6a20e78c311ebf18ba9e8c881 Mon Sep 17 00:00:00 2001 From: Shumilov Petr Date: Thu, 11 Aug 2022 15:27:00 +0300 Subject: [PATCH 06/84] Fix typo --- migrator/test/staticTS/formatChecker/utils/test_case.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migrator/test/staticTS/formatChecker/utils/test_case.py b/migrator/test/staticTS/formatChecker/utils/test_case.py index 62a477938..4a5c5ff29 100644 --- a/migrator/test/staticTS/formatChecker/utils/test_case.py +++ b/migrator/test/staticTS/formatChecker/utils/test_case.py @@ -3,7 +3,7 @@ from pathlib import Path from re import template from typing import Tuple -from utils.constants import NEGATIVE_PREFIX, SKIP_PREFIXES +from utils.constants import NEGATIVE_PREFIX, SKIP_PREFIX def is_negative(path: Path) -> bool: -- Gitee From ae7ea4e87f6cb640508a72907786e9f1809d367d Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Thu, 11 Aug 2022 16:31:14 +0300 Subject: [PATCH 07/84] Add compliance test suite files --- .../01.comments/multi_line_comment.sts | 24 +++++ .../01.comments/one_line_comment.sts | 6 ++ .../02.tokens/01.whitespaces/.gitattributes | 1 + .../02.line_separators/.gitattributes | 1 + .../03.identifiers/identifiers.sts | 7 ++ .../03.identifiers/identifiers_continue.sts | 9 ++ .../03.identifiers/identifiers_dollar.sts | 14 +++ .../03.identifiers/identifiers_start.sts | 9 ++ .../03.identifiers/list.continue.yaml | 4 + .../03.identifiers/list.start.yaml | 14 +++ .../03.identifiers/list.words.yaml | 7 ++ .../04.keywords/list.keywords.yaml | 40 +++++++ .../04.keywords/list.types.yaml | 11 ++ .../04.keywords/n.keywords.sts | 11 ++ .../04.keywords/n.types.sts | 11 ++ .../05.operators_and_punctuation/tbd.sts | 3 + .../01.integer_literals/int_literals.sts | 11 ++ .../list.bad_int_literals.yaml | 4 + .../list.int_literals.yaml | 5 + .../n.bad_int_literals.sts | 11 ++ .../float_literals.sts | 12 +++ .../list.float_literals.yaml | 36 +++++++ .../03.boolean_literals/boolean_literals.sts | 7 ++ .../04.string_literals/string_literals.sts | 6 ++ .../tbd.multiline_string_literals.sts | 3 + ...string_literals_escapes_n_continuation.sts | 3 + .../05.char_literals/char_literals.sts | 12 +++ .../05.char_literals/list.char_literals.yaml | 4 + .../06.null_literal/null_literal.sts | 6 ++ .../tbd.automatic_semicolon_insertion.sts | 3 + .../01.integer_type/integer_types.sts | 11 ++ .../01.integer_type/list.integer_types.yaml | 15 +++ .../02.float_type/float_types.sts | 11 ++ .../02.float_type/float_types_nan.sts | 11 ++ .../02.float_type/list.float_types.yaml | 7 ++ .../03.boolean_type/boolean_type.sts | 7 ++ .../04.char_type/char_type.sts | 7 ++ .../05.void_type/void_type.sts | 5 + .../default_value.sts | 13 +++ .../list.default_value.yaml | 10 ++ .../tbd.implicit_numeric_conversion.sts | 3 + .../CTS/03.types/02.array_type/array_type.sts | 7 ++ .../03.named_types/list.named_types.yaml | 5 + .../list.named_types_generics.yaml | 5 + .../03.types/03.named_types/named_types.sts | 12 +++ .../03.named_types/named_types_generics.sts | 12 +++ .../01.object_type/object_type.sts | 8 ++ .../02.string_type/string_type.sts | 8 ++ .../05.type_reference/tbd.type_reference.sts | 3 + .../01.names/list.qualified_names.yaml | 10 ++ .../01.names/qualified_name.sts | 24 +++++ .../tbd.n.unique_decl_name.sts | 3 + .../list.var_decl.yaml | 4 + .../01.variable_declarations/n.var_decl.sts | 5 + .../tbd.initialize_before_use.sts | 3 + .../01.variable_declarations/var_decl.sts | 13 +++ .../02.constant_declarations/const_decl.sts | 13 +++ .../list.bad_const_decl.yaml | 4 + .../list.const_decl.yaml | 4 + .../02.constant_declarations/n.const_decl.sts | 13 +++ .../initializer_compatibility.sts | 17 +++ .../list.type_and_initializer.yaml | 38 +++++++ .../list.self_dependency.yaml | 7 ++ .../list.toplevel_class_modifiers.yaml | 5 + .../list.wrong_constraints.yaml | 20 ++++ .../n.generic_class_self_dependency.sts | 16 +++ .../n.generic_class_wrong_constraint.sts | 16 +++ .../list.widening_primitives.yaml | 7 ++ .../widening.sts | 13 +++ .../boxing_conversion.sts | 15 +++ .../boxing_coversion_nan.sts | 16 +++ .../list.boxing_conversion.yaml | 10 ++ .../07.boxing_conversion/list.boxing_nan.yaml | 4 + .../list.unboxing_conversion.yaml | 10 ++ .../unboxing_conversion.sts | 15 +++ .../08.class_literal/class_literal.sts | 9 ++ .../09.array_literal/array_literal.sts | 11 ++ .../09.array_literal/list.array_literal.yaml | 8 ++ .../list.paren_expr.yaml | 6 ++ .../paren_expr.sts | 13 +++ .../array_access.sts | 13 +++ .../function_invocation_expr.sts | 16 +++ .../class_instance.sts | 14 +++ .../list.class_instance.yaml | 4 + .../array_creation.sts | 13 +++ .../list.array_creation.yaml | 17 +++ .../postfix_increment.sts | 9 ++ .../postfix_decrement.sts | 9 ++ .../prefix_increment.sts | 9 ++ .../prefix_decrement.sts | 9 ++ .../05.unary_plus_operator/unary_plus.sts | 8 ++ .../list.unary_minus_corner.yaml | 7 ++ .../list.unary_minus_inbound.yaml | 11 ++ .../list.unary_minus_onbound.yaml | 6 ++ .../unary_minus_corner.sts | 14 +++ .../unary_minus_inbound.sts | 13 +++ .../unary_minus_onbound.sts | 14 +++ .../bitwise_complement.sts | 13 +++ .../list.bitwise_complement.yaml | 38 +++++++ .../tbd.bitwise_long_int.sts | 3 + .../list.logical_complement.yaml | 4 + .../logical_complement.sts | 12 +++ .../01.integer_bitwise_operators/gen.go.txt | 45 ++++++++ .../integer_and.sts | 15 +++ .../integer_or.sts | 15 +++ .../integer_xor.sts | 15 +++ .../list.integer_and.yaml | 101 ++++++++++++++++++ .../list.integer_or.yaml | 101 ++++++++++++++++++ .../list.integer_xor.yaml | 101 ++++++++++++++++++ .../tbd.large_size_operations.sts | 3 + .../list.logical_ops.yaml | 16 +++ .../logical_bitwise_bool.sts | 15 +++ .../logical_bitwise_boolean.sts | 15 +++ .../conditional_and_bool.sts | 13 +++ .../conditional_and_boolean.sts | 13 +++ .../tbd.n.conditional_and_bool.sts | 3 + .../conditional_or_bool.sts | 13 +++ .../conditional_or_boolean.sts | 13 +++ .../tbd.n.conditional_or_bool.sts | 3 + .../conditional_expression_evaluation.sts | 22 ++++ .../conditional_expression_order.sts | 10 ++ .../expression_statement.sts | 13 +++ .../list.expression_statements.yaml | 6 ++ .../02.block/block_statement.sts | 15 +++ .../02.block/list.block_statements.yaml | 8 ++ .../labeled_statement.sts | 8 ++ .../empty_interface_declaration.sts | 15 +++ ...interface_declaration_with_type_params.sts | 15 +++ .../interface_fields.sts | 14 +++ .../interface_fields_without_types.sts | 14 +++ .../list.default_value.yaml | 10 ++ .../list.identifiers.yaml | 8 ++ .../list.identifiers_list.yaml | 6 ++ .../n.interface_extends_without_type.sts | 5 + .../several_interface_fields.sts | 9 ++ .../any_number_of_constants.sts | 14 +++ .../01.enum_constants/list.identifiers.yaml | 8 ++ .../01.enum_constants/n.empty_enum.sts | 6 ++ .../n.repeating_constants.sts | 9 ++ .../n.trailing_comma_enum.sts | 9 ++ .../01.enum_constants/simple_enum.sts | 9 ++ .../enum_constant_ordinals.sts | 15 +++ .../enum_constant_to_string.sts | 15 +++ .../02.import_declarations/import.sts | 11 ++ .../02.import_declarations/import_as.sts | 11 ++ .../list.qualified_names.yaml | 6 ++ .../02.import_declarations/list.words.yaml | 8 ++ .../n.import_all_as.sts | 11 ++ .../export_declarations.sts | 12 +++ .../list.grouped_declarations.yaml | 5 + .../list.toplevel_declarations.yaml | 21 ++++ .../n.exported_grouped_declarations.sts | 12 +++ .../list.identifiers.yaml | 8 ++ .../multiple_entrypoints.sts | 13 +++ 154 files changed, 1944 insertions(+) create mode 100644 migrator/test/staticTS/CTS/02.lexical_elements/01.comments/multi_line_comment.sts create mode 100644 migrator/test/staticTS/CTS/02.lexical_elements/01.comments/one_line_comment.sts create mode 100644 migrator/test/staticTS/CTS/02.lexical_elements/02.tokens/01.whitespaces/.gitattributes create mode 100644 migrator/test/staticTS/CTS/02.lexical_elements/02.tokens/02.line_separators/.gitattributes create mode 100644 migrator/test/staticTS/CTS/02.lexical_elements/03.identifiers/identifiers.sts create mode 100644 migrator/test/staticTS/CTS/02.lexical_elements/03.identifiers/identifiers_continue.sts create mode 100644 migrator/test/staticTS/CTS/02.lexical_elements/03.identifiers/identifiers_dollar.sts create mode 100644 migrator/test/staticTS/CTS/02.lexical_elements/03.identifiers/identifiers_start.sts create mode 100644 migrator/test/staticTS/CTS/02.lexical_elements/03.identifiers/list.continue.yaml create mode 100644 migrator/test/staticTS/CTS/02.lexical_elements/03.identifiers/list.start.yaml create mode 100644 migrator/test/staticTS/CTS/02.lexical_elements/03.identifiers/list.words.yaml create mode 100644 migrator/test/staticTS/CTS/02.lexical_elements/04.keywords/list.keywords.yaml create mode 100644 migrator/test/staticTS/CTS/02.lexical_elements/04.keywords/list.types.yaml create mode 100644 migrator/test/staticTS/CTS/02.lexical_elements/04.keywords/n.keywords.sts create mode 100644 migrator/test/staticTS/CTS/02.lexical_elements/04.keywords/n.types.sts create mode 100644 migrator/test/staticTS/CTS/02.lexical_elements/05.operators_and_punctuation/tbd.sts create mode 100644 migrator/test/staticTS/CTS/02.lexical_elements/06.literals/01.integer_literals/int_literals.sts create mode 100644 migrator/test/staticTS/CTS/02.lexical_elements/06.literals/01.integer_literals/list.bad_int_literals.yaml create mode 100644 migrator/test/staticTS/CTS/02.lexical_elements/06.literals/01.integer_literals/list.int_literals.yaml create mode 100644 migrator/test/staticTS/CTS/02.lexical_elements/06.literals/01.integer_literals/n.bad_int_literals.sts create mode 100644 migrator/test/staticTS/CTS/02.lexical_elements/06.literals/02.floating_point_literals/float_literals.sts create mode 100644 migrator/test/staticTS/CTS/02.lexical_elements/06.literals/02.floating_point_literals/list.float_literals.yaml create mode 100644 migrator/test/staticTS/CTS/02.lexical_elements/06.literals/03.boolean_literals/boolean_literals.sts create mode 100644 migrator/test/staticTS/CTS/02.lexical_elements/06.literals/04.string_literals/string_literals.sts create mode 100644 migrator/test/staticTS/CTS/02.lexical_elements/06.literals/04.string_literals/tbd.multiline_string_literals.sts create mode 100644 migrator/test/staticTS/CTS/02.lexical_elements/06.literals/04.string_literals/tbd.string_literals_escapes_n_continuation.sts create mode 100644 migrator/test/staticTS/CTS/02.lexical_elements/06.literals/05.char_literals/char_literals.sts create mode 100644 migrator/test/staticTS/CTS/02.lexical_elements/06.literals/05.char_literals/list.char_literals.yaml create mode 100644 migrator/test/staticTS/CTS/02.lexical_elements/06.literals/06.null_literal/null_literal.sts create mode 100644 migrator/test/staticTS/CTS/02.lexical_elements/07.automatic_semicolon_insertion/tbd.automatic_semicolon_insertion.sts create mode 100644 migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/01.integer_type/integer_types.sts create mode 100644 migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/01.integer_type/list.integer_types.yaml create mode 100644 migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/02.float_type/float_types.sts create mode 100644 migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/02.float_type/float_types_nan.sts create mode 100644 migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/02.float_type/list.float_types.yaml create mode 100644 migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/03.boolean_type/boolean_type.sts create mode 100644 migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/04.char_type/char_type.sts create mode 100644 migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/05.void_type/void_type.sts create mode 100644 migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/06.default_values_for_primitive_types/default_value.sts create mode 100644 migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/06.default_values_for_primitive_types/list.default_value.yaml create mode 100644 migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/07.implicit_conversion_for_numeric_types/tbd.implicit_numeric_conversion.sts create mode 100644 migrator/test/staticTS/CTS/03.types/02.array_type/array_type.sts create mode 100644 migrator/test/staticTS/CTS/03.types/03.named_types/list.named_types.yaml create mode 100644 migrator/test/staticTS/CTS/03.types/03.named_types/list.named_types_generics.yaml create mode 100644 migrator/test/staticTS/CTS/03.types/03.named_types/named_types.sts create mode 100644 migrator/test/staticTS/CTS/03.types/03.named_types/named_types_generics.sts create mode 100644 migrator/test/staticTS/CTS/03.types/04.predefined_named_types/01.object_type/object_type.sts create mode 100644 migrator/test/staticTS/CTS/03.types/04.predefined_named_types/02.string_type/string_type.sts create mode 100644 migrator/test/staticTS/CTS/03.types/05.type_reference/tbd.type_reference.sts create mode 100644 migrator/test/staticTS/CTS/04.names_declarations_and_scopes/01.names/list.qualified_names.yaml create mode 100644 migrator/test/staticTS/CTS/04.names_declarations_and_scopes/01.names/qualified_name.sts create mode 100644 migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/tbd.n.unique_decl_name.sts create mode 100644 migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/01.variable_declarations/list.var_decl.yaml create mode 100644 migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/01.variable_declarations/n.var_decl.sts create mode 100644 migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/01.variable_declarations/tbd.initialize_before_use.sts create mode 100644 migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/01.variable_declarations/var_decl.sts create mode 100644 migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/02.constant_declarations/const_decl.sts create mode 100644 migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/02.constant_declarations/list.bad_const_decl.yaml create mode 100644 migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/02.constant_declarations/list.const_decl.yaml create mode 100644 migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/02.constant_declarations/n.const_decl.sts create mode 100644 migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/03.type_compatibility_with_initializer/initializer_compatibility.sts create mode 100644 migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/03.type_compatibility_with_initializer/list.type_and_initializer.yaml create mode 100644 migrator/test/staticTS/CTS/05.generic_and_parameterized_declarations/01.generic_declarations/01.generic_classes/list.self_dependency.yaml create mode 100644 migrator/test/staticTS/CTS/05.generic_and_parameterized_declarations/01.generic_declarations/01.generic_classes/list.toplevel_class_modifiers.yaml create mode 100644 migrator/test/staticTS/CTS/05.generic_and_parameterized_declarations/01.generic_declarations/01.generic_classes/list.wrong_constraints.yaml create mode 100644 migrator/test/staticTS/CTS/05.generic_and_parameterized_declarations/01.generic_declarations/01.generic_classes/n.generic_class_self_dependency.sts create mode 100644 migrator/test/staticTS/CTS/05.generic_and_parameterized_declarations/01.generic_declarations/01.generic_classes/n.generic_class_wrong_constraint.sts create mode 100644 migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/02.widening_primitive_conversion/list.widening_primitives.yaml create mode 100644 migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/02.widening_primitive_conversion/widening.sts create mode 100644 migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/07.boxing_conversion/boxing_conversion.sts create mode 100644 migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/07.boxing_conversion/boxing_coversion_nan.sts create mode 100644 migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/07.boxing_conversion/list.boxing_conversion.yaml create mode 100644 migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/07.boxing_conversion/list.boxing_nan.yaml create mode 100644 migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/08.unboxing_conversion/list.unboxing_conversion.yaml create mode 100644 migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/08.unboxing_conversion/unboxing_conversion.sts create mode 100644 migrator/test/staticTS/CTS/07.expressions/08.class_literal/class_literal.sts create mode 100644 migrator/test/staticTS/CTS/07.expressions/09.array_literal/array_literal.sts create mode 100644 migrator/test/staticTS/CTS/07.expressions/09.array_literal/list.array_literal.yaml create mode 100644 migrator/test/staticTS/CTS/07.expressions/10.parenthesized_expression/list.paren_expr.yaml create mode 100644 migrator/test/staticTS/CTS/07.expressions/10.parenthesized_expression/paren_expr.sts create mode 100644 migrator/test/staticTS/CTS/07.expressions/14.array_access_expression/array_access.sts create mode 100644 migrator/test/staticTS/CTS/07.expressions/15.function_invocation_expression/function_invocation_expr.sts create mode 100644 migrator/test/staticTS/CTS/07.expressions/16.new_expression/01.class_instance_creation_expression/class_instance.sts create mode 100644 migrator/test/staticTS/CTS/07.expressions/16.new_expression/01.class_instance_creation_expression/list.class_instance.yaml create mode 100644 migrator/test/staticTS/CTS/07.expressions/16.new_expression/02.array_creation_instance/array_creation.sts create mode 100644 migrator/test/staticTS/CTS/07.expressions/16.new_expression/02.array_creation_instance/list.array_creation.yaml create mode 100644 migrator/test/staticTS/CTS/07.expressions/17.unary_operators/01.postfix_increment_operator/postfix_increment.sts create mode 100644 migrator/test/staticTS/CTS/07.expressions/17.unary_operators/02.postfix_decrement_operator/postfix_decrement.sts create mode 100644 migrator/test/staticTS/CTS/07.expressions/17.unary_operators/03.prefix_increment_operator/prefix_increment.sts create mode 100644 migrator/test/staticTS/CTS/07.expressions/17.unary_operators/04.prefix_decrement_operator/prefix_decrement.sts create mode 100644 migrator/test/staticTS/CTS/07.expressions/17.unary_operators/05.unary_plus_operator/unary_plus.sts create mode 100644 migrator/test/staticTS/CTS/07.expressions/17.unary_operators/06.unary_minus_operator/list.unary_minus_corner.yaml create mode 100644 migrator/test/staticTS/CTS/07.expressions/17.unary_operators/06.unary_minus_operator/list.unary_minus_inbound.yaml create mode 100644 migrator/test/staticTS/CTS/07.expressions/17.unary_operators/06.unary_minus_operator/list.unary_minus_onbound.yaml create mode 100644 migrator/test/staticTS/CTS/07.expressions/17.unary_operators/06.unary_minus_operator/unary_minus_corner.sts create mode 100644 migrator/test/staticTS/CTS/07.expressions/17.unary_operators/06.unary_minus_operator/unary_minus_inbound.sts create mode 100644 migrator/test/staticTS/CTS/07.expressions/17.unary_operators/06.unary_minus_operator/unary_minus_onbound.sts create mode 100644 migrator/test/staticTS/CTS/07.expressions/17.unary_operators/07.bitwise_complement_operator/bitwise_complement.sts create mode 100644 migrator/test/staticTS/CTS/07.expressions/17.unary_operators/07.bitwise_complement_operator/list.bitwise_complement.yaml create mode 100644 migrator/test/staticTS/CTS/07.expressions/17.unary_operators/07.bitwise_complement_operator/tbd.bitwise_long_int.sts create mode 100644 migrator/test/staticTS/CTS/07.expressions/17.unary_operators/08.logical_complement_operator/list.logical_complement.yaml create mode 100644 migrator/test/staticTS/CTS/07.expressions/17.unary_operators/08.logical_complement_operator/logical_complement.sts create mode 100644 migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/gen.go.txt create mode 100644 migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/integer_and.sts create mode 100644 migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/integer_or.sts create mode 100644 migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/integer_xor.sts create mode 100644 migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/list.integer_and.yaml create mode 100644 migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/list.integer_or.yaml create mode 100644 migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/list.integer_xor.yaml create mode 100644 migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/tbd.large_size_operations.sts create mode 100644 migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/02.logical_bitwise_operators/list.logical_ops.yaml create mode 100644 migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/02.logical_bitwise_operators/logical_bitwise_bool.sts create mode 100644 migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/02.logical_bitwise_operators/logical_bitwise_boolean.sts create mode 100644 migrator/test/staticTS/CTS/07.expressions/26.conditional_and_operator/conditional_and_bool.sts create mode 100644 migrator/test/staticTS/CTS/07.expressions/26.conditional_and_operator/conditional_and_boolean.sts create mode 100644 migrator/test/staticTS/CTS/07.expressions/26.conditional_and_operator/tbd.n.conditional_and_bool.sts create mode 100644 migrator/test/staticTS/CTS/07.expressions/27.conditional_or_operator/conditional_or_bool.sts create mode 100644 migrator/test/staticTS/CTS/07.expressions/27.conditional_or_operator/conditional_or_boolean.sts create mode 100644 migrator/test/staticTS/CTS/07.expressions/27.conditional_or_operator/tbd.n.conditional_or_bool.sts create mode 100644 migrator/test/staticTS/CTS/07.expressions/29.conditional_expressions/conditional_expression_evaluation.sts create mode 100644 migrator/test/staticTS/CTS/07.expressions/29.conditional_expressions/conditional_expression_order.sts create mode 100644 migrator/test/staticTS/CTS/08.statements/01.expression_statement/expression_statement.sts create mode 100644 migrator/test/staticTS/CTS/08.statements/01.expression_statement/list.expression_statements.yaml create mode 100644 migrator/test/staticTS/CTS/08.statements/02.block/block_statement.sts create mode 100644 migrator/test/staticTS/CTS/08.statements/02.block/list.block_statements.yaml create mode 100644 migrator/test/staticTS/CTS/08.statements/03.labeled_statement/labeled_statement.sts create mode 100644 migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/empty_interface_declaration.sts create mode 100644 migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/empty_interface_declaration_with_type_params.sts create mode 100644 migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/interface_fields.sts create mode 100644 migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/interface_fields_without_types.sts create mode 100644 migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/list.default_value.yaml create mode 100644 migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/list.identifiers.yaml create mode 100644 migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/list.identifiers_list.yaml create mode 100644 migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/n.interface_extends_without_type.sts create mode 100644 migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/several_interface_fields.sts create mode 100644 migrator/test/staticTS/CTS/11.enums/01.enum_constants/any_number_of_constants.sts create mode 100644 migrator/test/staticTS/CTS/11.enums/01.enum_constants/list.identifiers.yaml create mode 100644 migrator/test/staticTS/CTS/11.enums/01.enum_constants/n.empty_enum.sts create mode 100644 migrator/test/staticTS/CTS/11.enums/01.enum_constants/n.repeating_constants.sts create mode 100644 migrator/test/staticTS/CTS/11.enums/01.enum_constants/n.trailing_comma_enum.sts create mode 100644 migrator/test/staticTS/CTS/11.enums/01.enum_constants/simple_enum.sts create mode 100644 migrator/test/staticTS/CTS/11.enums/03.enum_constant_methods/enum_constant_ordinals.sts create mode 100644 migrator/test/staticTS/CTS/11.enums/03.enum_constant_methods/enum_constant_to_string.sts create mode 100644 migrator/test/staticTS/CTS/13.packages/02.import_declarations/import.sts create mode 100644 migrator/test/staticTS/CTS/13.packages/02.import_declarations/import_as.sts create mode 100644 migrator/test/staticTS/CTS/13.packages/02.import_declarations/list.qualified_names.yaml create mode 100644 migrator/test/staticTS/CTS/13.packages/02.import_declarations/list.words.yaml create mode 100644 migrator/test/staticTS/CTS/13.packages/02.import_declarations/n.import_all_as.sts create mode 100644 migrator/test/staticTS/CTS/13.packages/05.export_declarations/export_declarations.sts create mode 100644 migrator/test/staticTS/CTS/13.packages/05.export_declarations/list.grouped_declarations.yaml create mode 100644 migrator/test/staticTS/CTS/13.packages/05.export_declarations/list.toplevel_declarations.yaml create mode 100644 migrator/test/staticTS/CTS/13.packages/05.export_declarations/n.exported_grouped_declarations.sts create mode 100644 migrator/test/staticTS/CTS/13.packages/06.program_entry_point/list.identifiers.yaml create mode 100644 migrator/test/staticTS/CTS/13.packages/06.program_entry_point/multiple_entrypoints.sts diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/01.comments/multi_line_comment.sts b/migrator/test/staticTS/CTS/02.lexical_elements/01.comments/multi_line_comment.sts new file mode 100644 index 000000000..b8179d84f --- /dev/null +++ b/migrator/test/staticTS/CTS/02.lexical_elements/01.comments/multi_line_comment.sts @@ -0,0 +1,24 @@ +/*--- +desc: Multi-line comments +---*/ + +/**/ + +/* + block +*/ + +/* + /* + nested block + */ +*/ + +/* + // nested one-liner +*/ + +// /* + +// */ +function main(): void {} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/01.comments/one_line_comment.sts b/migrator/test/staticTS/CTS/02.lexical_elements/01.comments/one_line_comment.sts new file mode 100644 index 000000000..979c26029 --- /dev/null +++ b/migrator/test/staticTS/CTS/02.lexical_elements/01.comments/one_line_comment.sts @@ -0,0 +1,6 @@ +/*--- +desc: Line comment +---*/ + +// one-liner +function main(): void {} diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/02.tokens/01.whitespaces/.gitattributes b/migrator/test/staticTS/CTS/02.lexical_elements/02.tokens/01.whitespaces/.gitattributes new file mode 100644 index 000000000..460fe17b8 --- /dev/null +++ b/migrator/test/staticTS/CTS/02.lexical_elements/02.tokens/01.whitespaces/.gitattributes @@ -0,0 +1 @@ +whitespaces.sts binary diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/02.tokens/02.line_separators/.gitattributes b/migrator/test/staticTS/CTS/02.lexical_elements/02.tokens/02.line_separators/.gitattributes new file mode 100644 index 000000000..c8e18f51d --- /dev/null +++ b/migrator/test/staticTS/CTS/02.lexical_elements/02.tokens/02.line_separators/.gitattributes @@ -0,0 +1 @@ +line_separators.sts binary diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/03.identifiers/identifiers.sts b/migrator/test/staticTS/CTS/02.lexical_elements/03.identifiers/identifiers.sts new file mode 100644 index 000000000..b385e2e2c --- /dev/null +++ b/migrator/test/staticTS/CTS/02.lexical_elements/03.identifiers/identifiers.sts @@ -0,0 +1,7 @@ +/*--- +desc: Identifiers +---*/ + +let simple_ident: int = 1; +let _underscore_ident: int = 2; +let $dollar_ident: int = 3; diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/03.identifiers/identifiers_continue.sts b/migrator/test/staticTS/CTS/02.lexical_elements/03.identifiers/identifiers_continue.sts new file mode 100644 index 000000000..03df7e76d --- /dev/null +++ b/migrator/test/staticTS/CTS/02.lexical_elements/03.identifiers/identifiers_continue.sts @@ -0,0 +1,9 @@ +{% for ident in continue %} +/*--- +desc: Other character {{.ident}} should be Unicode code point with the Unicode property "ID_Continue" +---*/ + +let X{{.ident}} = 0; +function main(): void {} + +{% endfor %} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/03.identifiers/identifiers_dollar.sts b/migrator/test/staticTS/CTS/02.lexical_elements/03.identifiers/identifiers_dollar.sts new file mode 100644 index 000000000..57027d412 --- /dev/null +++ b/migrator/test/staticTS/CTS/02.lexical_elements/03.identifiers/identifiers_dollar.sts @@ -0,0 +1,14 @@ +{% for word1 in words %} + {% for word2 in words %} + +/*--- +desc: Identifiers with '$' in the middle +params: {{.word1}}${{.word2}} +---*/ + +let {{.word1}}${{.word2}} = 1; + +function {{.word2}}${{.word1}}(): void {} + + {% endfor %} +{% endfor %} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/03.identifiers/identifiers_start.sts b/migrator/test/staticTS/CTS/02.lexical_elements/03.identifiers/identifiers_start.sts new file mode 100644 index 000000000..806e31a4b --- /dev/null +++ b/migrator/test/staticTS/CTS/02.lexical_elements/03.identifiers/identifiers_start.sts @@ -0,0 +1,9 @@ +{% for ident in start %} +/*--- +desc: First character {{.ident}} should be Unicode code point with the Unicode property "ID_Start" +---*/ + +let {{.ident}} = 0; +function main(): void {} + +{% endfor %} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/03.identifiers/list.continue.yaml b/migrator/test/staticTS/CTS/02.lexical_elements/03.identifiers/list.continue.yaml new file mode 100644 index 000000000..d65bb1f92 --- /dev/null +++ b/migrator/test/staticTS/CTS/02.lexical_elements/03.identifiers/list.continue.yaml @@ -0,0 +1,4 @@ +--- +- a\u0024 +- a‌\u0024 # Zero Width Non-Joiner (U+200C) between a and \u0024 +- a‍\u0024 # Zero Width Joiner (U+200D) between a and \u0024 \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/03.identifiers/list.start.yaml b/migrator/test/staticTS/CTS/02.lexical_elements/03.identifiers/list.start.yaml new file mode 100644 index 000000000..2e39d0bc2 --- /dev/null +++ b/migrator/test/staticTS/CTS/02.lexical_elements/03.identifiers/list.start.yaml @@ -0,0 +1,14 @@ +--- # List of possible ident start symbols +- $ +- _ +- \\u0024 +- q +- Q +- я +- Я +- Î +- î +- ʻ # Modifier Letter Turned Comma +- ⅲ # Small Roman Numeral Three +- ℘ # Script Capital P +- ǂ # Latin Letter Alveolar Click diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/03.identifiers/list.words.yaml b/migrator/test/staticTS/CTS/02.lexical_elements/03.identifiers/list.words.yaml new file mode 100644 index 000000000..2a6474bac --- /dev/null +++ b/migrator/test/staticTS/CTS/02.lexical_elements/03.identifiers/list.words.yaml @@ -0,0 +1,7 @@ +--- # List of simple words that can be used as identifiers +- "yes" +- "no" +- x +- xx +- y +- identifier diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/04.keywords/list.keywords.yaml b/migrator/test/staticTS/CTS/02.lexical_elements/04.keywords/list.keywords.yaml new file mode 100644 index 000000000..478aea8a4 --- /dev/null +++ b/migrator/test/staticTS/CTS/02.lexical_elements/04.keywords/list.keywords.yaml @@ -0,0 +1,40 @@ +--- # List of keywords +- abstract +- as +- assert +- break +- case +- class +- const +- constructor +- continue +- default +- do +- else +- enum +- export +- extends +- "false" +- for +- function +- if +- implements +- import +- interface +- let +- new +- "null" +- of +- open +- override +- package +- private +- protected +- public +- return +- static +- super +- switch +- this +- "true" +- while diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/04.keywords/list.types.yaml b/migrator/test/staticTS/CTS/02.lexical_elements/04.keywords/list.types.yaml new file mode 100644 index 000000000..740870dcc --- /dev/null +++ b/migrator/test/staticTS/CTS/02.lexical_elements/04.keywords/list.types.yaml @@ -0,0 +1,11 @@ +--- # List of keywords denoting predefined data types +- boolean +- byte +- char +- double +- float +- int +- long +- short +- string +- void diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/04.keywords/n.keywords.sts b/migrator/test/staticTS/CTS/02.lexical_elements/04.keywords/n.keywords.sts new file mode 100644 index 000000000..ccff91630 --- /dev/null +++ b/migrator/test/staticTS/CTS/02.lexical_elements/04.keywords/n.keywords.sts @@ -0,0 +1,11 @@ +{% for kwd in keywords %} + +/*--- +desc: The {{.kwd}} is reserved and may not be used as identifiers +params: {{.kwd}} +---*/ + +let {{.kwd}} = 0; +function main(): void {} + +{% endfor %} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/04.keywords/n.types.sts b/migrator/test/staticTS/CTS/02.lexical_elements/04.keywords/n.types.sts new file mode 100644 index 000000000..729d4d8b0 --- /dev/null +++ b/migrator/test/staticTS/CTS/02.lexical_elements/04.keywords/n.types.sts @@ -0,0 +1,11 @@ +{% for type in types %} + +/*--- +desc: The keyword {{.type}} denotes predefined type name and may not be used as identifier +params: {{.type}} +---*/ + +let {{.type}} = 0; +function main(): void {} + +{% endfor %} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/05.operators_and_punctuation/tbd.sts b/migrator/test/staticTS/CTS/02.lexical_elements/05.operators_and_punctuation/tbd.sts new file mode 100644 index 000000000..c0a645b37 --- /dev/null +++ b/migrator/test/staticTS/CTS/02.lexical_elements/05.operators_and_punctuation/tbd.sts @@ -0,0 +1,3 @@ +/*--- +desc: Operators and punctuation +---*/ \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/01.integer_literals/int_literals.sts b/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/01.integer_literals/int_literals.sts new file mode 100644 index 000000000..a9feb52b5 --- /dev/null +++ b/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/01.integer_literals/int_literals.sts @@ -0,0 +1,11 @@ +{% for lit in int_literals %} + +/*--- +desc: Correct integer literals with bases 16, 10, 8 and 2 +params: {{.lit}} +---*/ + +let x = {{.lit}}; +function main(): void {} + +{% endfor %} diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/01.integer_literals/list.bad_int_literals.yaml b/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/01.integer_literals/list.bad_int_literals.yaml new file mode 100644 index 000000000..32b901877 --- /dev/null +++ b/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/01.integer_literals/list.bad_int_literals.yaml @@ -0,0 +1,4 @@ +--- # List of invalid integer literals +- 0x +- 0o +- 0b diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/01.integer_literals/list.int_literals.yaml b/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/01.integer_literals/list.int_literals.yaml new file mode 100644 index 000000000..fc70bb74e --- /dev/null +++ b/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/01.integer_literals/list.int_literals.yaml @@ -0,0 +1,5 @@ +--- # List of valid integer literals +- 153 # Decimal literal +- 0xDAD # Hex literal +- 0o777 # Octal literal +- 0b101 # Binary literal diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/01.integer_literals/n.bad_int_literals.sts b/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/01.integer_literals/n.bad_int_literals.sts new file mode 100644 index 000000000..54bc2584f --- /dev/null +++ b/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/01.integer_literals/n.bad_int_literals.sts @@ -0,0 +1,11 @@ +{% for lit in bad_int_literals %} + +/*--- +desc: Incorrect integer literals +params: {{.lit}} +---*/ + +let x = {{.lit}}; +function main(): void {} + +{% endfor %} diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/02.floating_point_literals/float_literals.sts b/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/02.floating_point_literals/float_literals.sts new file mode 100644 index 000000000..99e1f69fd --- /dev/null +++ b/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/02.floating_point_literals/float_literals.sts @@ -0,0 +1,12 @@ +{% for f in float_literals %} + +/*--- +desc: Floating-point literals +params: {{.f}} +---*/ + +let x = {{.f}}; + +function main(): void {} + +{% endfor %} diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/02.floating_point_literals/list.float_literals.yaml b/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/02.floating_point_literals/list.float_literals.yaml new file mode 100644 index 000000000..9a54008a8 --- /dev/null +++ b/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/02.floating_point_literals/list.float_literals.yaml @@ -0,0 +1,36 @@ +--- # List of valid float literals + +- 0.0 +- 0. + +- 0.e1 +- 0.0e1 +- 0.0e+1 +- 0.0e-1 +- 0.0e-11 + +- 0.E1 +- 0.0E1 +- 0.0E+1 +- 0.0E-1 +- 0.0E-11 + +- .0 +- .0e0 +- .0e+1 +- .0e-1 +- .0e11 + +- .0 +- .0E0 +- .0E+1 +- .0E-1 +- .0E11 + +- 1e0 +- 1e-1 +- 1e+1 + +- 1E0 +- 1E-1 +- 1E+1 diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/03.boolean_literals/boolean_literals.sts b/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/03.boolean_literals/boolean_literals.sts new file mode 100644 index 000000000..1cf65a021 --- /dev/null +++ b/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/03.boolean_literals/boolean_literals.sts @@ -0,0 +1,7 @@ +/*--- +desc: Boolean literals +---*/ + +let t = true; +let f = false; +function main(): void {} diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/04.string_literals/string_literals.sts b/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/04.string_literals/string_literals.sts new file mode 100644 index 000000000..f5adb0bcb --- /dev/null +++ b/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/04.string_literals/string_literals.sts @@ -0,0 +1,6 @@ +/*--- +desc: String literals +---*/ + +let x = "hello"; +function main(): void {} diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/04.string_literals/tbd.multiline_string_literals.sts b/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/04.string_literals/tbd.multiline_string_literals.sts new file mode 100644 index 000000000..f2299c898 --- /dev/null +++ b/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/04.string_literals/tbd.multiline_string_literals.sts @@ -0,0 +1,3 @@ +/*--- +desc: Multiline string literals +---*/ \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/04.string_literals/tbd.string_literals_escapes_n_continuation.sts b/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/04.string_literals/tbd.string_literals_escapes_n_continuation.sts new file mode 100644 index 000000000..a9d35f726 --- /dev/null +++ b/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/04.string_literals/tbd.string_literals_escapes_n_continuation.sts @@ -0,0 +1,3 @@ +/*--- +desc: String with line continuation and escape sequences +---*/ \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/05.char_literals/char_literals.sts b/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/05.char_literals/char_literals.sts new file mode 100644 index 000000000..2f05f8f28 --- /dev/null +++ b/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/05.char_literals/char_literals.sts @@ -0,0 +1,12 @@ +{% for ch in char_literals %} + +/*--- +desc: Correct char literals +params: {{.ch}} +---*/ + +let x = {{.ch}}; + +function main(): void {} + +{% endfor %} diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/05.char_literals/list.char_literals.yaml b/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/05.char_literals/list.char_literals.yaml new file mode 100644 index 000000000..850690d2c --- /dev/null +++ b/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/05.char_literals/list.char_literals.yaml @@ -0,0 +1,4 @@ +--- # List of correct char literals +- 'ʻ' +- 'a' +- '\u0000' diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/06.null_literal/null_literal.sts b/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/06.null_literal/null_literal.sts new file mode 100644 index 000000000..e5eaf5316 --- /dev/null +++ b/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/06.null_literal/null_literal.sts @@ -0,0 +1,6 @@ +/*--- +desc: Null literal +---*/ + +let x= null; +function main(): void {} diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/07.automatic_semicolon_insertion/tbd.automatic_semicolon_insertion.sts b/migrator/test/staticTS/CTS/02.lexical_elements/07.automatic_semicolon_insertion/tbd.automatic_semicolon_insertion.sts new file mode 100644 index 000000000..4785dddf1 --- /dev/null +++ b/migrator/test/staticTS/CTS/02.lexical_elements/07.automatic_semicolon_insertion/tbd.automatic_semicolon_insertion.sts @@ -0,0 +1,3 @@ +/*--- +desc: Automatic Semicolon Insertion +---*/ \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/01.integer_type/integer_types.sts b/migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/01.integer_type/integer_types.sts new file mode 100644 index 000000000..593a2e422 --- /dev/null +++ b/migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/01.integer_type/integer_types.sts @@ -0,0 +1,11 @@ +{% for item in integer_types %} + +/*--- +desc: Integer type {{.item.type}} +params: {{.item.type}}, {{.item.value}} +---*/ + +let x: {{.item.type}} = {{.item.value}}; +function main(): void {} + +{% endfor %} diff --git a/migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/01.integer_type/list.integer_types.yaml b/migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/01.integer_type/list.integer_types.yaml new file mode 100644 index 000000000..9a16681f9 --- /dev/null +++ b/migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/01.integer_type/list.integer_types.yaml @@ -0,0 +1,15 @@ +--- # List of valid values for specific integer types + +- {type: byte, value: 127} +- {type: byte, value: -128} + +- {type: short, value: 32767} +- {type: short, value: -32768} + +- {type: int, value: 2147483647} +- {type: int, value: -2147483648} + +- {type: long, value: 9223372036854775807} +- {type: long, value: -9223372036854775808} + + diff --git a/migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/02.float_type/float_types.sts b/migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/02.float_type/float_types.sts new file mode 100644 index 000000000..99d689774 --- /dev/null +++ b/migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/02.float_type/float_types.sts @@ -0,0 +1,11 @@ + +/*--- +desc: Floating-point type NaN values +corner-case: true +---*/ + +let f: float = NaN; +let d: double = NaN; + +function main(): void {} + diff --git a/migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/02.float_type/float_types_nan.sts b/migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/02.float_type/float_types_nan.sts new file mode 100644 index 000000000..a2355f9d0 --- /dev/null +++ b/migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/02.float_type/float_types_nan.sts @@ -0,0 +1,11 @@ +{% for item in float_types %} + +/*--- +desc: Floating-point type {{.item.type}} +params: {{.item.type}}, {{.item.value}} +---*/ + +let x: {{.item.type}} = {{.item.value}}; +function main(): void {} + +{% endfor %} diff --git a/migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/02.float_type/list.float_types.yaml b/migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/02.float_type/list.float_types.yaml new file mode 100644 index 000000000..cb577565d --- /dev/null +++ b/migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/02.float_type/list.float_types.yaml @@ -0,0 +1,7 @@ +--- # List of valid values for specific float types + +- {type: float, value: "3.4028235e38"} +- {type: float, value: "1.40e-45"} + +- {type: double, value: "1.7976931348623157e308"} +- {type: double, value: "4.9e-324"} diff --git a/migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/03.boolean_type/boolean_type.sts b/migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/03.boolean_type/boolean_type.sts new file mode 100644 index 000000000..e4cb2660d --- /dev/null +++ b/migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/03.boolean_type/boolean_type.sts @@ -0,0 +1,7 @@ +/*--- +desc: Boolean type +---*/ + +let t: boolean = true; +let f: boolean = false; +function main(): void {} diff --git a/migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/04.char_type/char_type.sts b/migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/04.char_type/char_type.sts new file mode 100644 index 000000000..298b74dae --- /dev/null +++ b/migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/04.char_type/char_type.sts @@ -0,0 +1,7 @@ +/*--- +desc: Char type +---*/ + +let charMin: char = '\u0000'; +let charMax: char = '\uffff'; +function main(): void {} diff --git a/migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/05.void_type/void_type.sts b/migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/05.void_type/void_type.sts new file mode 100644 index 000000000..0e0719b06 --- /dev/null +++ b/migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/05.void_type/void_type.sts @@ -0,0 +1,5 @@ +/*--- +desc: void type +---*/ + +function main(): void {} diff --git a/migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/06.default_values_for_primitive_types/default_value.sts b/migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/06.default_values_for_primitive_types/default_value.sts new file mode 100644 index 000000000..53a0c7329 --- /dev/null +++ b/migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/06.default_values_for_primitive_types/default_value.sts @@ -0,0 +1,13 @@ +{% for i in default_value %} + +/*--- +desc: Default value for primitive type {{.i.type}} +params: {{.i.type}}, {{.i.value}} +---*/ + +let x: {{.i.type}}; +function main(): void { + assert(x == {{.i.value}}); +} + +{% endfor %} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/06.default_values_for_primitive_types/list.default_value.yaml b/migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/06.default_values_for_primitive_types/list.default_value.yaml new file mode 100644 index 000000000..9ffc292f9 --- /dev/null +++ b/migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/06.default_values_for_primitive_types/list.default_value.yaml @@ -0,0 +1,10 @@ +--- # List of default values for primitive types + +- {type: byte, value: 0} +- {type: short, value: 0} +- {type: int, value: 0} +- {type: long, value: 0} +- {type: float, value: 0.0} +- {type: double, value: 0.0} +- {type: char, value: '\u0000'} +- {type: boolean, value: false} diff --git a/migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/07.implicit_conversion_for_numeric_types/tbd.implicit_numeric_conversion.sts b/migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/07.implicit_conversion_for_numeric_types/tbd.implicit_numeric_conversion.sts new file mode 100644 index 000000000..d620c7ed2 --- /dev/null +++ b/migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/07.implicit_conversion_for_numeric_types/tbd.implicit_numeric_conversion.sts @@ -0,0 +1,3 @@ +/*--- +desc: Implicit numeric conversion for primitive type +---*/ \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/03.types/02.array_type/array_type.sts b/migrator/test/staticTS/CTS/03.types/02.array_type/array_type.sts new file mode 100644 index 000000000..ec6bbe9cc --- /dev/null +++ b/migrator/test/staticTS/CTS/03.types/02.array_type/array_type.sts @@ -0,0 +1,7 @@ +/*--- +desc: Array type +---*/ + +let a: int[]; +function main(): void {} + diff --git a/migrator/test/staticTS/CTS/03.types/03.named_types/list.named_types.yaml b/migrator/test/staticTS/CTS/03.types/03.named_types/list.named_types.yaml new file mode 100644 index 000000000..5c271ede9 --- /dev/null +++ b/migrator/test/staticTS/CTS/03.types/03.named_types/list.named_types.yaml @@ -0,0 +1,5 @@ +--- # List of named type declarations + +- class a {} +- interface b {} +- enum c {v1, v2} diff --git a/migrator/test/staticTS/CTS/03.types/03.named_types/list.named_types_generics.yaml b/migrator/test/staticTS/CTS/03.types/03.named_types/list.named_types_generics.yaml new file mode 100644 index 000000000..28de02d9f --- /dev/null +++ b/migrator/test/staticTS/CTS/03.types/03.named_types/list.named_types_generics.yaml @@ -0,0 +1,5 @@ +--- # List of named type declarations (with generics) + +- class a {} +- interface b {} +# - enum c {v1, v2} -- not implemented in grammar yet diff --git a/migrator/test/staticTS/CTS/03.types/03.named_types/named_types.sts b/migrator/test/staticTS/CTS/03.types/03.named_types/named_types.sts new file mode 100644 index 000000000..b9537f40a --- /dev/null +++ b/migrator/test/staticTS/CTS/03.types/03.named_types/named_types.sts @@ -0,0 +1,12 @@ +{% for named in named_types %} + +/*--- +desc: Named type {{.named}} +params: {{.named}} +---*/ + +{{.named}} + +function main(): void {} + +{% endfor %} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/03.types/03.named_types/named_types_generics.sts b/migrator/test/staticTS/CTS/03.types/03.named_types/named_types_generics.sts new file mode 100644 index 000000000..2d52a0094 --- /dev/null +++ b/migrator/test/staticTS/CTS/03.types/03.named_types/named_types_generics.sts @@ -0,0 +1,12 @@ +{% for named in named_types_generics %} + +/*--- +desc: Generic named type {{.named}} +params: {{.named}} +---*/ + +{{.named}} + +function main(): void {} + +{% endfor %} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/03.types/04.predefined_named_types/01.object_type/object_type.sts b/migrator/test/staticTS/CTS/03.types/04.predefined_named_types/01.object_type/object_type.sts new file mode 100644 index 000000000..f643191df --- /dev/null +++ b/migrator/test/staticTS/CTS/03.types/04.predefined_named_types/01.object_type/object_type.sts @@ -0,0 +1,8 @@ +/*--- +desc: Object type +---*/ + +let x: Object; +let y: std.core.Object; + +function main(): void {} diff --git a/migrator/test/staticTS/CTS/03.types/04.predefined_named_types/02.string_type/string_type.sts b/migrator/test/staticTS/CTS/03.types/04.predefined_named_types/02.string_type/string_type.sts new file mode 100644 index 000000000..57516b073 --- /dev/null +++ b/migrator/test/staticTS/CTS/03.types/04.predefined_named_types/02.string_type/string_type.sts @@ -0,0 +1,8 @@ +/*--- +desc: String type +---*/ + +let x: String; +let y: std.core.String; + +function main(): void {} diff --git a/migrator/test/staticTS/CTS/03.types/05.type_reference/tbd.type_reference.sts b/migrator/test/staticTS/CTS/03.types/05.type_reference/tbd.type_reference.sts new file mode 100644 index 000000000..a65c1eae4 --- /dev/null +++ b/migrator/test/staticTS/CTS/03.types/05.type_reference/tbd.type_reference.sts @@ -0,0 +1,3 @@ +/*--- +desc: Type reference +---*/ \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/01.names/list.qualified_names.yaml b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/01.names/list.qualified_names.yaml new file mode 100644 index 000000000..758de0bd4 --- /dev/null +++ b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/01.names/list.qualified_names.yaml @@ -0,0 +1,10 @@ +--- # All possible qualified names + +- test.Class; +- test.Instance; +- Class.StaticField; +- Class.StaticMethod(); +- test.Class.StaticField; +- test.Class.StaticMethod(); +- Instance.Field; +- Instance.Method(); diff --git a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/01.names/qualified_name.sts b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/01.names/qualified_name.sts new file mode 100644 index 000000000..785a9b37c --- /dev/null +++ b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/01.names/qualified_name.sts @@ -0,0 +1,24 @@ +{% for qname in qualified_names %} + +/*--- +desc: Qualified name {{.qname}} +params: {{.qname}} +---*/ + +package test; + +class Class { + static StaticField: int; + static StaticMethod(): void {} + + Field: int; + Method(): void {} +} + +let Instance: Class = new Class; + +function main(): void { + {{.qname}} +} + +{% endfor %} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/tbd.n.unique_decl_name.sts b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/tbd.n.unique_decl_name.sts new file mode 100644 index 000000000..a976cfb15 --- /dev/null +++ b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/tbd.n.unique_decl_name.sts @@ -0,0 +1,3 @@ +/*--- +desc: A name must be unique in its declaration space +---*/ \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/01.variable_declarations/list.var_decl.yaml b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/01.variable_declarations/list.var_decl.yaml new file mode 100644 index 000000000..58f7ac772 --- /dev/null +++ b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/01.variable_declarations/list.var_decl.yaml @@ -0,0 +1,4 @@ +--- # List of all possible var declaration forms +- "let a: int;" +- "let b = 1;" +- "let c: int = 6, d = 1, e = \"hello\";" diff --git a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/01.variable_declarations/n.var_decl.sts b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/01.variable_declarations/n.var_decl.sts new file mode 100644 index 000000000..f44da71ad --- /dev/null +++ b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/01.variable_declarations/n.var_decl.sts @@ -0,0 +1,5 @@ +/*--- +desc: Incorrect variable declaration +---*/ + +var x; diff --git a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/01.variable_declarations/tbd.initialize_before_use.sts b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/01.variable_declarations/tbd.initialize_before_use.sts new file mode 100644 index 000000000..544722a75 --- /dev/null +++ b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/01.variable_declarations/tbd.initialize_before_use.sts @@ -0,0 +1,3 @@ +/*--- +desc: Every variable in a program must have a value before its value is used +---*/ \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/01.variable_declarations/var_decl.sts b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/01.variable_declarations/var_decl.sts new file mode 100644 index 000000000..ea115b03f --- /dev/null +++ b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/01.variable_declarations/var_decl.sts @@ -0,0 +1,13 @@ +{% for vd in var_decl %} + +/*--- +desc: A variable declaration introduces a named variable and optionally assigns it an initial value +params: > + {{.vd}} +---*/ + +{{.vd}} + +function main(): void {} + +{% endfor %} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/02.constant_declarations/const_decl.sts b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/02.constant_declarations/const_decl.sts new file mode 100644 index 000000000..7dd0185b0 --- /dev/null +++ b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/02.constant_declarations/const_decl.sts @@ -0,0 +1,13 @@ +{% for cd in const_decl %} + +/*--- +desc: A constant declaration introduces a named entity with mandatory initial value +params: > + {{.cd}} +---*/ + +{{.cd}} + +function main(): void {} + +{% endfor %} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/02.constant_declarations/list.bad_const_decl.yaml b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/02.constant_declarations/list.bad_const_decl.yaml new file mode 100644 index 000000000..2c1d4aa08 --- /dev/null +++ b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/02.constant_declarations/list.bad_const_decl.yaml @@ -0,0 +1,4 @@ +--- # List of incorrect const declaration forms +- "const x;" +- "const y: int;" + diff --git a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/02.constant_declarations/list.const_decl.yaml b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/02.constant_declarations/list.const_decl.yaml new file mode 100644 index 000000000..5cade5d2e --- /dev/null +++ b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/02.constant_declarations/list.const_decl.yaml @@ -0,0 +1,4 @@ +--- # List of all possible correct const declaration forms +- "const a: int = 1;" +- "const b = 1;" +- "const c: int = 6, d = 1, e = \"hello\";" diff --git a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/02.constant_declarations/n.const_decl.sts b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/02.constant_declarations/n.const_decl.sts new file mode 100644 index 000000000..d332e73e8 --- /dev/null +++ b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/02.constant_declarations/n.const_decl.sts @@ -0,0 +1,13 @@ +{% for cd in bad_const_decl %} + +/*--- +desc: Incorrect constant definition +params: > + {{.cd}} +---*/ + +{{.cd}} + +function main(): void {} + +{% endfor %} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/03.type_compatibility_with_initializer/initializer_compatibility.sts b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/03.type_compatibility_with_initializer/initializer_compatibility.sts new file mode 100644 index 000000000..076dea90c --- /dev/null +++ b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/03.type_compatibility_with_initializer/initializer_compatibility.sts @@ -0,0 +1,17 @@ +{% for i in type_and_initializer %} + +/*--- +desc: Type {{.i.type}} compartibility with initializer {{.i.value}} +params: !!str + {{.i.typedecl}} + {{.i.type}} + {{.i.value}} +---*/ + +{{.i.typedecl}} + +function main(): void { + let a: {{.i.type}} = {{.i.value}}; +} + +{% endfor %} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/03.type_compatibility_with_initializer/list.type_and_initializer.yaml b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/03.type_compatibility_with_initializer/list.type_and_initializer.yaml new file mode 100644 index 000000000..46f65a45e --- /dev/null +++ b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/03.type_compatibility_with_initializer/list.type_and_initializer.yaml @@ -0,0 +1,38 @@ +--- # Type, TypeDecl and initializer + +# Integer types + +- {type: byte, value: 127} +- {type: byte, value: -128} + +- {type: short, value: 32767} +- {type: short, value: -32768} + +- {type: int, value: 2147483647} +- {type: int, value: -2147483648} + +- {type: long, value: 9223372036854775807} +- {type: long, value: -9223372036854775808} + +# Float types + +- {type: float, value: "3.4028235e38"} +- {type: float, value: "1.40e-45"} + +- {type: double, value: "1.7976931348623157e308"} +- {type: double, value: "4.9e-324"} + +# Char type + +- {type: char, value: \u0000} +- {type: char, value: \uFFFF} + +# Class type + +- {type: "A", typedecl: "class A {}", value: "new A"} +- {type: "A", typedecl: "class A {} \n class B extends A {}", value: "new B"} + +# Interface type + +# Enum type + diff --git a/migrator/test/staticTS/CTS/05.generic_and_parameterized_declarations/01.generic_declarations/01.generic_classes/list.self_dependency.yaml b/migrator/test/staticTS/CTS/05.generic_and_parameterized_declarations/01.generic_declarations/01.generic_classes/list.self_dependency.yaml new file mode 100644 index 000000000..5ae3aeb53 --- /dev/null +++ b/migrator/test/staticTS/CTS/05.generic_and_parameterized_declarations/01.generic_declarations/01.generic_classes/list.self_dependency.yaml @@ -0,0 +1,7 @@ +--- # Self dependency tests + +- T +- U +- U> +- U> +- T diff --git a/migrator/test/staticTS/CTS/05.generic_and_parameterized_declarations/01.generic_declarations/01.generic_classes/list.toplevel_class_modifiers.yaml b/migrator/test/staticTS/CTS/05.generic_and_parameterized_declarations/01.generic_declarations/01.generic_classes/list.toplevel_class_modifiers.yaml new file mode 100644 index 000000000..6bfc2812d --- /dev/null +++ b/migrator/test/staticTS/CTS/05.generic_and_parameterized_declarations/01.generic_declarations/01.generic_classes/list.toplevel_class_modifiers.yaml @@ -0,0 +1,5 @@ +--- # Toplevel class modifier list + +- "" +- abstract +- open diff --git a/migrator/test/staticTS/CTS/05.generic_and_parameterized_declarations/01.generic_declarations/01.generic_classes/list.wrong_constraints.yaml b/migrator/test/staticTS/CTS/05.generic_and_parameterized_declarations/01.generic_declarations/01.generic_classes/list.wrong_constraints.yaml new file mode 100644 index 000000000..bed00fe09 --- /dev/null +++ b/migrator/test/staticTS/CTS/05.generic_and_parameterized_declarations/01.generic_declarations/01.generic_classes/list.wrong_constraints.yaml @@ -0,0 +1,20 @@ +--- # Wrong type constraints for generic parameters + +- boolean +- byte +- char +- double +- float +- int +- int && Object +- int && Object && String +- long +- Object && int +- Object && int && String +- Object && String && int +- short +- void +- "enum Color { Red, Green, Blue }" +- "int[]" +- "int, extends Object" +- "Object, extends int" diff --git a/migrator/test/staticTS/CTS/05.generic_and_parameterized_declarations/01.generic_declarations/01.generic_classes/n.generic_class_self_dependency.sts b/migrator/test/staticTS/CTS/05.generic_and_parameterized_declarations/01.generic_declarations/01.generic_classes/n.generic_class_self_dependency.sts new file mode 100644 index 000000000..d63f0678c --- /dev/null +++ b/migrator/test/staticTS/CTS/05.generic_and_parameterized_declarations/01.generic_declarations/01.generic_classes/n.generic_class_self_dependency.sts @@ -0,0 +1,16 @@ +{% for sd in self_dependency %} +{% for cm in toplevel_class_modifiers %} + +/*--- +desc: Self-dependency is prohibited +params: > + {{.sd}} + {{.cm}} +---*/ + +{{.cm}} class T<{{.sd}}> {} + +function main(): void {} + +{% endfor %} +{% endfor %} diff --git a/migrator/test/staticTS/CTS/05.generic_and_parameterized_declarations/01.generic_declarations/01.generic_classes/n.generic_class_wrong_constraint.sts b/migrator/test/staticTS/CTS/05.generic_and_parameterized_declarations/01.generic_declarations/01.generic_classes/n.generic_class_wrong_constraint.sts new file mode 100644 index 000000000..7c6fbddb0 --- /dev/null +++ b/migrator/test/staticTS/CTS/05.generic_and_parameterized_declarations/01.generic_declarations/01.generic_classes/n.generic_class_wrong_constraint.sts @@ -0,0 +1,16 @@ +{% for wc in wrong_constraints %} +{% for cm in toplevel_class_modifiers %} + +/*--- +desc: Self-dependency is prohibited +params: > + {{.wc}} + {{.cm}} +---*/ + +{{.cm}} class Point {} + +function main(): void {} + +{% endfor %} +{% endfor %} diff --git a/migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/02.widening_primitive_conversion/list.widening_primitives.yaml b/migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/02.widening_primitive_conversion/list.widening_primitives.yaml new file mode 100644 index 000000000..44cf7e865 --- /dev/null +++ b/migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/02.widening_primitive_conversion/list.widening_primitives.yaml @@ -0,0 +1,7 @@ +--- # List of allowed widening primitives conversions + +- {origin: byte, dest: [short, int, long, float, double]} +- {origin: short, dest: [int, long, float, double]} +- {origin: int, dest: [long, float, double]} +- {origin: long, dest: [float, double]} +- {origin: float, dest: [double]} diff --git a/migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/02.widening_primitive_conversion/widening.sts b/migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/02.widening_primitive_conversion/widening.sts new file mode 100644 index 000000000..38c58bff3 --- /dev/null +++ b/migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/02.widening_primitive_conversion/widening.sts @@ -0,0 +1,13 @@ +{% for wid in widening_primitives %} +/*--- +desc: Widening primitive type {{.wid.origin}} +---*/ +let origin: {{.wid.origin}} = 0; + +function main(): void { +{%- for t in wid['dest'] %} + let x{{.t}}: {{.t}} = origin; +{%- endfor %} +} + +{% endfor %} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/07.boxing_conversion/boxing_conversion.sts b/migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/07.boxing_conversion/boxing_conversion.sts new file mode 100644 index 000000000..c04b87e74 --- /dev/null +++ b/migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/07.boxing_conversion/boxing_conversion.sts @@ -0,0 +1,15 @@ +{% for conv in boxing_conversion %} + +/*--- +desc: Boxing conversion for types +---*/ + +let origin: {{.conv.origin}} = {{.conv.value}}; +let dest: {{.conv.dest}}; + +function main(): void { + dest = origin; + assert(dest.{{.conv.origin}}Value() == origin); +} + +{% endfor %} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/07.boxing_conversion/boxing_coversion_nan.sts b/migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/07.boxing_conversion/boxing_coversion_nan.sts new file mode 100644 index 000000000..5f9b1aa14 --- /dev/null +++ b/migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/07.boxing_conversion/boxing_coversion_nan.sts @@ -0,0 +1,16 @@ +{% for conv in boxing_nan %} + +/*--- +desc: Boxing conversion floating-point types (NaN) +corner-case: true +---*/ + +let origin: {{.conv.origin}} = NaN; +let dest: {{.conv.dest}}; + +function main(): void { + dest = origin; + assert(dest.isNaN()); +} + +{% endfor %} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/07.boxing_conversion/list.boxing_conversion.yaml b/migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/07.boxing_conversion/list.boxing_conversion.yaml new file mode 100644 index 000000000..4322817a7 --- /dev/null +++ b/migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/07.boxing_conversion/list.boxing_conversion.yaml @@ -0,0 +1,10 @@ +--- # List of boxing conversions + +- {origin: boolean, dest: Boolean, value: "true"} +- {origin: byte, dest: Byte, value: 1} +- {origin: short, dest: Short, value: 1} +- {origin: int, dest: Integer, value: 1} +- {origin: long, dest: Long, value: 1} +- {origin: char, dest: Character, value: 'a'} +- {origin: float, dest: Float, value: 1.0} +- {origin: double, dest: Double, value: 1.0} diff --git a/migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/07.boxing_conversion/list.boxing_nan.yaml b/migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/07.boxing_conversion/list.boxing_nan.yaml new file mode 100644 index 000000000..66ce1b026 --- /dev/null +++ b/migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/07.boxing_conversion/list.boxing_nan.yaml @@ -0,0 +1,4 @@ +--- # List of boxing conversion (NaN) + +- {origin: float, dest: Float} +- {origin: double, dest: Double} diff --git a/migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/08.unboxing_conversion/list.unboxing_conversion.yaml b/migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/08.unboxing_conversion/list.unboxing_conversion.yaml new file mode 100644 index 000000000..39851730e --- /dev/null +++ b/migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/08.unboxing_conversion/list.unboxing_conversion.yaml @@ -0,0 +1,10 @@ +--- # List of unboxing conversions + +- {origin: Boolean, dest: boolean, value: "true"} +- {origin: Byte, dest: byte, value: 1} +- {origin: Short, dest: short, value: 1} +- {origin: Integer, dest: integer, value: 1} +- {origin: Long, dest: long, value: 1} +- {origin: Character, dest: character, value: 'a'} +- {origin: Float, dest: float, value: 1.0} +- {origin: Double, dest: double, value: 1.0} diff --git a/migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/08.unboxing_conversion/unboxing_conversion.sts b/migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/08.unboxing_conversion/unboxing_conversion.sts new file mode 100644 index 000000000..d3874afdb --- /dev/null +++ b/migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/08.unboxing_conversion/unboxing_conversion.sts @@ -0,0 +1,15 @@ +{% for conv in unboxing_conversion %} + +/*--- +desc: Unboxing conversion for types +---*/ + +let origin: {{.conv.origin}} = {{.conv.value}}; +let dest: {{.conv.dest}}; + +function main(): void { + dest = origin; + assert(dest == origin.{{.conv.dest}}Value()); +} + +{% endfor %} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/08.class_literal/class_literal.sts b/migrator/test/staticTS/CTS/07.expressions/08.class_literal/class_literal.sts new file mode 100644 index 000000000..6caf04fec --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/08.class_literal/class_literal.sts @@ -0,0 +1,9 @@ +/*--- +desc: Class literal +---*/ + +class C {} + +let x = C.class; + +function main(): void {} diff --git a/migrator/test/staticTS/CTS/07.expressions/09.array_literal/array_literal.sts b/migrator/test/staticTS/CTS/07.expressions/09.array_literal/array_literal.sts new file mode 100644 index 000000000..c0e6b04c4 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/09.array_literal/array_literal.sts @@ -0,0 +1,11 @@ +{% for item in array_literal %} + +/*--- +desc: Array literal +params: {{.item.array}} +---*/ + +let x = {{.item.array}}; +function main(): void {} + +{% endfor %} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/09.array_literal/list.array_literal.yaml b/migrator/test/staticTS/CTS/07.expressions/09.array_literal/list.array_literal.yaml new file mode 100644 index 000000000..6edf37eea --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/09.array_literal/list.array_literal.yaml @@ -0,0 +1,8 @@ +--- # List of valid array literals + +- {array: []} +- {array: [1]} +- {array: [1, 2, 3]} +- {array: [1+1, 2, 1+3]} +- {array: ["aaa", "bbb"]} +- {array: [3.1456926]} diff --git a/migrator/test/staticTS/CTS/07.expressions/10.parenthesized_expression/list.paren_expr.yaml b/migrator/test/staticTS/CTS/07.expressions/10.parenthesized_expression/list.paren_expr.yaml new file mode 100644 index 000000000..7bbbd27e4 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/10.parenthesized_expression/list.paren_expr.yaml @@ -0,0 +1,6 @@ +--- # List of parenthesis expression + +- "(x)" +- "((x))" +- "(((x) + (x) - (x)))" +- "(((x))) + (((x))) - (((x)))" diff --git a/migrator/test/staticTS/CTS/07.expressions/10.parenthesized_expression/paren_expr.sts b/migrator/test/staticTS/CTS/07.expressions/10.parenthesized_expression/paren_expr.sts new file mode 100644 index 000000000..c7f452815 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/10.parenthesized_expression/paren_expr.sts @@ -0,0 +1,13 @@ +{% for e in paren_expr %} +/*--- +desc: Parenthesized expression +---*/ + +let x = 1; +let y = {{.e}}; + +function main(): void { + assert(x == y); +} + +{% endfor %} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/14.array_access_expression/array_access.sts b/migrator/test/staticTS/CTS/07.expressions/14.array_access_expression/array_access.sts new file mode 100644 index 000000000..e9ec94fc4 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/14.array_access_expression/array_access.sts @@ -0,0 +1,13 @@ +/*--- +desc: Array access expression +---*/ + +let arr = [1, 2, 3]; + +function main(): void { + let x = arr[0]; + let y = arr[x]; + let z = arr[x+1]; + + assert(x == 1 && y == 2 && z == 3); +} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/15.function_invocation_expression/function_invocation_expr.sts b/migrator/test/staticTS/CTS/07.expressions/15.function_invocation_expression/function_invocation_expr.sts new file mode 100644 index 000000000..c31a2063b --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/15.function_invocation_expression/function_invocation_expr.sts @@ -0,0 +1,16 @@ +/*--- +desc: Function invocation expression +---*/ + +function callee(a: int, b: bool): int { + if (b) { + return a; + } else { + return -a; + } +} + +function main(): void { + assert(callee(1, true) == 1); + assert(callee(1, false) == -1); +} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/16.new_expression/01.class_instance_creation_expression/class_instance.sts b/migrator/test/staticTS/CTS/07.expressions/16.new_expression/01.class_instance_creation_expression/class_instance.sts new file mode 100644 index 000000000..aadc9608f --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/16.new_expression/01.class_instance_creation_expression/class_instance.sts @@ -0,0 +1,14 @@ +{% for ins in class_instance %} + +/*--- +desc: Class instance creation expression +params: {{.ins.init}} +---*/ + +{{.ins.decl}} + +function main(): void { + let x = {{.ins.init}}; +} + +{% endfor %} diff --git a/migrator/test/staticTS/CTS/07.expressions/16.new_expression/01.class_instance_creation_expression/list.class_instance.yaml b/migrator/test/staticTS/CTS/07.expressions/16.new_expression/01.class_instance_creation_expression/list.class_instance.yaml new file mode 100644 index 000000000..b15c2ed9d --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/16.new_expression/01.class_instance_creation_expression/list.class_instance.yaml @@ -0,0 +1,4 @@ +--- # List of valid class instance creation samples + +- {decl: "class A {}", init: "new A"} +- {decl: "", init: "new std.core.String"} diff --git a/migrator/test/staticTS/CTS/07.expressions/16.new_expression/02.array_creation_instance/array_creation.sts b/migrator/test/staticTS/CTS/07.expressions/16.new_expression/02.array_creation_instance/array_creation.sts new file mode 100644 index 000000000..edca887d3 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/16.new_expression/02.array_creation_instance/array_creation.sts @@ -0,0 +1,13 @@ +{% for exp in array_creation %} + +/*--- +desc: Array creation expression +---*/ + +class A {} + +let x = new {{.exp}}; + +function main(): void {} + +{% endfor %} diff --git a/migrator/test/staticTS/CTS/07.expressions/16.new_expression/02.array_creation_instance/list.array_creation.yaml b/migrator/test/staticTS/CTS/07.expressions/16.new_expression/02.array_creation_instance/list.array_creation.yaml new file mode 100644 index 000000000..60c5f9c3f --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/16.new_expression/02.array_creation_instance/list.array_creation.yaml @@ -0,0 +1,17 @@ +--- # List of valid array creation expressions + +- "A[1]" +- "byte[1]" +- "int[1]" +- "short[1]" +- "long[1]" +- "float[1]" +- "double[1]" + +- "A[1][1]" +- "byte[1][1]" +- "int[1][1]" +- "short[1][1]" +- "long[1][1]" +- "float[1][1]" +- "double[1][1]" diff --git a/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/01.postfix_increment_operator/postfix_increment.sts b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/01.postfix_increment_operator/postfix_increment.sts new file mode 100644 index 000000000..2f73ae219 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/01.postfix_increment_operator/postfix_increment.sts @@ -0,0 +1,9 @@ +/*--- +desc: Postfix increment operator +---*/ + +function main(): void { + let a = 5; + assert(a++ == 5); + assert(a == 6); +} diff --git a/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/02.postfix_decrement_operator/postfix_decrement.sts b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/02.postfix_decrement_operator/postfix_decrement.sts new file mode 100644 index 000000000..531d0c23e --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/02.postfix_decrement_operator/postfix_decrement.sts @@ -0,0 +1,9 @@ +/*--- +desc: Postfix decrement operator +---*/ + +function main(): void { + let a = 5; + assert(a-- == 5); + assert(a == 4); +} diff --git a/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/03.prefix_increment_operator/prefix_increment.sts b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/03.prefix_increment_operator/prefix_increment.sts new file mode 100644 index 000000000..4fddeb5df --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/03.prefix_increment_operator/prefix_increment.sts @@ -0,0 +1,9 @@ +/*--- +desc: Prefix increment operator +---*/ + +function main(): void { + let a = 5; + assert(++a == 6); + assert(a == 6); +} diff --git a/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/04.prefix_decrement_operator/prefix_decrement.sts b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/04.prefix_decrement_operator/prefix_decrement.sts new file mode 100644 index 000000000..6f2bd2d67 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/04.prefix_decrement_operator/prefix_decrement.sts @@ -0,0 +1,9 @@ +/*--- +desc: Prefix decrement operator +---*/ + +function main(): void { + let a = 5; + assert(--a == 4); + assert(a == 4); +} diff --git a/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/05.unary_plus_operator/unary_plus.sts b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/05.unary_plus_operator/unary_plus.sts new file mode 100644 index 000000000..ac6af76f9 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/05.unary_plus_operator/unary_plus.sts @@ -0,0 +1,8 @@ +/*--- +desc: Unary plus operator +---*/ + +function main(): void { + let a = 5; + assert(+a == a); +} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/06.unary_minus_operator/list.unary_minus_corner.yaml b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/06.unary_minus_operator/list.unary_minus_corner.yaml new file mode 100644 index 000000000..7ddd37da8 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/06.unary_minus_operator/list.unary_minus_corner.yaml @@ -0,0 +1,7 @@ +--- # List of corner cases for unary minus + +- {origin: NaN, dest: NaN} +- {origin: INF, dest: -INF} +- {origin: -INF, dest: INF} +- {origin: 0.0, dest: -0.0} +- {origin: -0.0, dest: 0.0} diff --git a/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/06.unary_minus_operator/list.unary_minus_inbound.yaml b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/06.unary_minus_operator/list.unary_minus_inbound.yaml new file mode 100644 index 000000000..4a606ca15 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/06.unary_minus_operator/list.unary_minus_inbound.yaml @@ -0,0 +1,11 @@ +--- # List of valid in-bound integer unary minus tests + +- {type: byte, origin: 127, dest: -127} +- {type: short, origin: 32767, dest: -32767} +- {type: int, origin: 2147483647, dest: -2147483647} +- {type: long, origin: 9223372036854775807, dest: -9223372036854775807} + +- {type: byte, origin: 0, dest: 0} +- {type: short, origin: 0, dest: 0} +- {type: int, origin: 0, dest: 0} +- {type: long, origin: 0, dest: 0} diff --git a/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/06.unary_minus_operator/list.unary_minus_onbound.yaml b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/06.unary_minus_operator/list.unary_minus_onbound.yaml new file mode 100644 index 000000000..03cfd41a3 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/06.unary_minus_operator/list.unary_minus_onbound.yaml @@ -0,0 +1,6 @@ +--- # List of valid on-bound integer unary minus tests + +- {type: byte, origin: -128, dest: -128} +- {type: short, origin: -32768, dest: -32768} +- {type: int, origin: -2147483648, dest: -2147483648} +- {type: long, origin: -9223372036854775808, dest: -9223372036854775808} diff --git a/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/06.unary_minus_operator/unary_minus_corner.sts b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/06.unary_minus_operator/unary_minus_corner.sts new file mode 100644 index 000000000..cccecfa10 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/06.unary_minus_operator/unary_minus_corner.sts @@ -0,0 +1,14 @@ +{% for un in unary_minus_corner %} + +/*--- +desc: Unary minus operator (corner cases) +corner-case: true +params: {{.un.origin}} => {{.un.dest}} +---*/ + +function main(): void { + let a = {{.un.origin}}; + assert(-a == {{.un.dest}}); +} + +{% endfor %} diff --git a/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/06.unary_minus_operator/unary_minus_inbound.sts b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/06.unary_minus_operator/unary_minus_inbound.sts new file mode 100644 index 000000000..4cb73f2c6 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/06.unary_minus_operator/unary_minus_inbound.sts @@ -0,0 +1,13 @@ +{% for inb in unary_minus_inbound %} + +/*--- +desc: Unary minus operator (inbound) +params: {{.inb.type}} {{.inb.origin}} => {{.inb.dest}} +---*/ + +function main(): void { + let a: {{.inb.type}} = {{.inb.origin}}; + assert(-a == {{.inb.dest}}); +} + +{% endfor %} diff --git a/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/06.unary_minus_operator/unary_minus_onbound.sts b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/06.unary_minus_operator/unary_minus_onbound.sts new file mode 100644 index 000000000..0c41bcebd --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/06.unary_minus_operator/unary_minus_onbound.sts @@ -0,0 +1,14 @@ +{% for onb in unary_minus_onbound %} + +/*--- +desc: Unary minus operator (inbound) +params: {{.onb.type}} {{.onb.origin}} => {{.onb.dest}} +corner-case: true +---*/ + +function main(): void { + let a: {{.onb.type}} = {{.onb.origin}}; + assert(-a == {{.onb.dest}}); +} + +{% endfor %} diff --git a/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/07.bitwise_complement_operator/bitwise_complement.sts b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/07.bitwise_complement_operator/bitwise_complement.sts new file mode 100644 index 000000000..89b0cb87b --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/07.bitwise_complement_operator/bitwise_complement.sts @@ -0,0 +1,13 @@ +{% for bw in bitwise_complement %} + +/*--- +desc: Bitwise complement operator +params: {{.bw.type}} {{.bw.origin}} => {{.bw.dest}} +---*/ + +function main(): void { + let a: {{.bw.type}} = {{.bw.origin}}; + assert(~a == {{.bw.dest}}); +} + +{% endfor %} diff --git a/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/07.bitwise_complement_operator/list.bitwise_complement.yaml b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/07.bitwise_complement_operator/list.bitwise_complement.yaml new file mode 100644 index 000000000..4944f8fd2 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/07.bitwise_complement_operator/list.bitwise_complement.yaml @@ -0,0 +1,38 @@ +--- # List of bitwise complement operator values + +- {type: byte, origin: 0, dest: -1} +- {type: byte, origin: 1, dest: -2} +- {type: byte, origin: 127, dest: -128} +- {type: byte, origin: -86, dest: 85} +- {type: byte, origin: 15, dest: -16} +- {type: byte, origin: 51, dest: -52} + +- {type: short, origin: 0, dest: -1} +- {type: short, origin: 1, dest: -2} +- {type: short, origin: 127, dest: -128} +- {type: short, origin: -86, dest: 85} +- {type: short, origin: 15, dest: -16} +- {type: short, origin: 51, dest: -52} +- {type: short, origin: 255, dest: -256} +- {type: short, origin: 21845, dest: -21846} +- {type: short, origin: -3856, dest: 3855} + +- {type: int, origin: 0, dest: -1} +- {type: int, origin: 1, dest: -2} +- {type: int, origin: 127, dest: -128} +- {type: int, origin: -86, dest: 85} +- {type: int, origin: 15, dest: -16} +- {type: int, origin: 51, dest: -52} +- {type: int, origin: 255, dest: -256} +- {type: int, origin: 21845, dest: -21846} +- {type: int, origin: -3856, dest: 3855} + +- {type: long, origin: 0, dest: -1} +- {type: long, origin: 1, dest: -2} +- {type: long, origin: 127, dest: -128} +- {type: long, origin: -86, dest: 85} +- {type: long, origin: 15, dest: -16} +- {type: long, origin: 51, dest: -52} +- {type: long, origin: 255, dest: -256} +- {type: long, origin: 21845, dest: -21846} +- {type: long, origin: -3856, dest: 3855} diff --git a/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/07.bitwise_complement_operator/tbd.bitwise_long_int.sts b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/07.bitwise_complement_operator/tbd.bitwise_long_int.sts new file mode 100644 index 000000000..4d2688ef4 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/07.bitwise_complement_operator/tbd.bitwise_long_int.sts @@ -0,0 +1,3 @@ +/*--- +desc: More tests for bitwise complement operator for large integers +---*/ \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/08.logical_complement_operator/list.logical_complement.yaml b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/08.logical_complement_operator/list.logical_complement.yaml new file mode 100644 index 000000000..af07c7c24 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/08.logical_complement_operator/list.logical_complement.yaml @@ -0,0 +1,4 @@ +--- # List of logical complement operator values + +- {origin: "true", dest: "false"} +- {origin: "false", dest: "true"} diff --git a/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/08.logical_complement_operator/logical_complement.sts b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/08.logical_complement_operator/logical_complement.sts new file mode 100644 index 000000000..8355f365d --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/08.logical_complement_operator/logical_complement.sts @@ -0,0 +1,12 @@ +{% for lc in logical_complement %} +/*--- +desc: Logical complement operator +params: {{.lc.origin}} => {{.lc.dest}} +---*/ + +function main(): void { + let a = {{.lc.origin}}; + assert(!a == {{.lc.dest}}); +} + +{% endfor %} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/gen.go.txt b/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/gen.go.txt new file mode 100644 index 000000000..6a1946062 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/gen.go.txt @@ -0,0 +1,45 @@ +package main + +import "fmt" + +var and8_op = func(x uint8, y uint8) uint8 { + return x & y +} + +var or8_op = func(x uint8, y uint8) uint8 { + return x | y +} + +var xor8_op = func(x uint8, y uint8) uint8 { + return x ^ y +} + +var data = []uint8{ + 0b00000000, + 0b01010101, + 0b10101010, + 0b00001111, + 0b11110000, + 0b00110011, + 0b11001100, + 0b10000001, + 0b10011001, + 0b01100110, +} + +func main() { + op := "\"^\"" + op1 := "xor" + _op := xor8_op + fmt.Println("--- # List of integer " + op1 + " " + op + " operations") + + for _, x := range data { + for _, y := range data { + res := _op(x, y) + fmt.Printf( + "- {xorigin: %4d, yorigin: %4d, op: %s, dest: %4d, xbits: \"0b%08b\", xbits: \"0b%08b\", dbits: \"0b%08b\"}\n", + int8(x), int8(y), op, int8(res), x, y, res, + ) + } + } +} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/integer_and.sts b/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/integer_and.sts new file mode 100644 index 000000000..dc6a4aef1 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/integer_and.sts @@ -0,0 +1,15 @@ +{% for i in integer_and %} + +/*--- +desc: Integer 'and' operation +params: {{.i.xorigin}} {{.i.op}} {{.i.yorigin}} == {{.i.dest}} ({{.i.xbits}} {{.i.op}} {{.i.ybits}} == {{.i.dbits}} ) +---*/ + +function main(): void { + let x: byte = {{.i.xorigin}}; + let y: byte = {{.i.yorigin}}; + let dest: byte = {{.i.dest}}; + assert((x {{.i.op}} y) == dest); +} + +{% endfor %} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/integer_or.sts b/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/integer_or.sts new file mode 100644 index 000000000..b03d591e9 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/integer_or.sts @@ -0,0 +1,15 @@ +{% for i in integer_or %} + +/*--- +desc: Integer 'or' operation +params: {{.i.xorigin}} {{.i.op}} {{.i.yorigin}} == {{.i.dest}} ({{.i.xbits}} {{.i.op}} {{.i.ybits}} == {{.i.dbits}} ) +---*/ + +function main(): void { + let x: byte = {{.i.xorigin}}; + let y: byte = {{.i.yorigin}}; + let dest: byte = {{.i.dest}}; + assert((x {{.i.op}} y) == dest); +} + +{% endfor %} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/integer_xor.sts b/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/integer_xor.sts new file mode 100644 index 000000000..628ccdad4 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/integer_xor.sts @@ -0,0 +1,15 @@ +{% for i in integer_xor %} + +/*--- +desc: Integer 'xor' operation +params: {{.i.xorigin}} {{.i.op}} {{.i.yorigin}} == {{.i.dest}} ({{.i.xbits}} {{.i.op}} {{.i.ybits}} == {{.i.dbits}} ) +---*/ + +function main(): void { + let x: byte = {{.i.xorigin}}; + let y: byte = {{.i.yorigin}}; + let dest: byte = {{.i.dest}}; + assert((x {{.i.op}} y) == dest); +} + +{% endfor %} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/list.integer_and.yaml b/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/list.integer_and.yaml new file mode 100644 index 000000000..7fcc8d3da --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/list.integer_and.yaml @@ -0,0 +1,101 @@ +--- # List of integer and "&" operations +- {xorigin: 0, yorigin: 0, op: "&", dest: 0, xbits: "0b00000000", xbits: "0b00000000", dbits: "0b00000000"} +- {xorigin: 0, yorigin: 85, op: "&", dest: 0, xbits: "0b00000000", xbits: "0b01010101", dbits: "0b00000000"} +- {xorigin: 0, yorigin: -86, op: "&", dest: 0, xbits: "0b00000000", xbits: "0b10101010", dbits: "0b00000000"} +- {xorigin: 0, yorigin: 15, op: "&", dest: 0, xbits: "0b00000000", xbits: "0b00001111", dbits: "0b00000000"} +- {xorigin: 0, yorigin: -16, op: "&", dest: 0, xbits: "0b00000000", xbits: "0b11110000", dbits: "0b00000000"} +- {xorigin: 0, yorigin: 51, op: "&", dest: 0, xbits: "0b00000000", xbits: "0b00110011", dbits: "0b00000000"} +- {xorigin: 0, yorigin: -52, op: "&", dest: 0, xbits: "0b00000000", xbits: "0b11001100", dbits: "0b00000000"} +- {xorigin: 0, yorigin: -127, op: "&", dest: 0, xbits: "0b00000000", xbits: "0b10000001", dbits: "0b00000000"} +- {xorigin: 0, yorigin: -103, op: "&", dest: 0, xbits: "0b00000000", xbits: "0b10011001", dbits: "0b00000000"} +- {xorigin: 0, yorigin: 102, op: "&", dest: 0, xbits: "0b00000000", xbits: "0b01100110", dbits: "0b00000000"} +- {xorigin: 85, yorigin: 0, op: "&", dest: 0, xbits: "0b01010101", xbits: "0b00000000", dbits: "0b00000000"} +- {xorigin: 85, yorigin: 85, op: "&", dest: 85, xbits: "0b01010101", xbits: "0b01010101", dbits: "0b01010101"} +- {xorigin: 85, yorigin: -86, op: "&", dest: 0, xbits: "0b01010101", xbits: "0b10101010", dbits: "0b00000000"} +- {xorigin: 85, yorigin: 15, op: "&", dest: 5, xbits: "0b01010101", xbits: "0b00001111", dbits: "0b00000101"} +- {xorigin: 85, yorigin: -16, op: "&", dest: 80, xbits: "0b01010101", xbits: "0b11110000", dbits: "0b01010000"} +- {xorigin: 85, yorigin: 51, op: "&", dest: 17, xbits: "0b01010101", xbits: "0b00110011", dbits: "0b00010001"} +- {xorigin: 85, yorigin: -52, op: "&", dest: 68, xbits: "0b01010101", xbits: "0b11001100", dbits: "0b01000100"} +- {xorigin: 85, yorigin: -127, op: "&", dest: 1, xbits: "0b01010101", xbits: "0b10000001", dbits: "0b00000001"} +- {xorigin: 85, yorigin: -103, op: "&", dest: 17, xbits: "0b01010101", xbits: "0b10011001", dbits: "0b00010001"} +- {xorigin: 85, yorigin: 102, op: "&", dest: 68, xbits: "0b01010101", xbits: "0b01100110", dbits: "0b01000100"} +- {xorigin: -86, yorigin: 0, op: "&", dest: 0, xbits: "0b10101010", xbits: "0b00000000", dbits: "0b00000000"} +- {xorigin: -86, yorigin: 85, op: "&", dest: 0, xbits: "0b10101010", xbits: "0b01010101", dbits: "0b00000000"} +- {xorigin: -86, yorigin: -86, op: "&", dest: -86, xbits: "0b10101010", xbits: "0b10101010", dbits: "0b10101010"} +- {xorigin: -86, yorigin: 15, op: "&", dest: 10, xbits: "0b10101010", xbits: "0b00001111", dbits: "0b00001010"} +- {xorigin: -86, yorigin: -16, op: "&", dest: -96, xbits: "0b10101010", xbits: "0b11110000", dbits: "0b10100000"} +- {xorigin: -86, yorigin: 51, op: "&", dest: 34, xbits: "0b10101010", xbits: "0b00110011", dbits: "0b00100010"} +- {xorigin: -86, yorigin: -52, op: "&", dest: -120, xbits: "0b10101010", xbits: "0b11001100", dbits: "0b10001000"} +- {xorigin: -86, yorigin: -127, op: "&", dest: -128, xbits: "0b10101010", xbits: "0b10000001", dbits: "0b10000000"} +- {xorigin: -86, yorigin: -103, op: "&", dest: -120, xbits: "0b10101010", xbits: "0b10011001", dbits: "0b10001000"} +- {xorigin: -86, yorigin: 102, op: "&", dest: 34, xbits: "0b10101010", xbits: "0b01100110", dbits: "0b00100010"} +- {xorigin: 15, yorigin: 0, op: "&", dest: 0, xbits: "0b00001111", xbits: "0b00000000", dbits: "0b00000000"} +- {xorigin: 15, yorigin: 85, op: "&", dest: 5, xbits: "0b00001111", xbits: "0b01010101", dbits: "0b00000101"} +- {xorigin: 15, yorigin: -86, op: "&", dest: 10, xbits: "0b00001111", xbits: "0b10101010", dbits: "0b00001010"} +- {xorigin: 15, yorigin: 15, op: "&", dest: 15, xbits: "0b00001111", xbits: "0b00001111", dbits: "0b00001111"} +- {xorigin: 15, yorigin: -16, op: "&", dest: 0, xbits: "0b00001111", xbits: "0b11110000", dbits: "0b00000000"} +- {xorigin: 15, yorigin: 51, op: "&", dest: 3, xbits: "0b00001111", xbits: "0b00110011", dbits: "0b00000011"} +- {xorigin: 15, yorigin: -52, op: "&", dest: 12, xbits: "0b00001111", xbits: "0b11001100", dbits: "0b00001100"} +- {xorigin: 15, yorigin: -127, op: "&", dest: 1, xbits: "0b00001111", xbits: "0b10000001", dbits: "0b00000001"} +- {xorigin: 15, yorigin: -103, op: "&", dest: 9, xbits: "0b00001111", xbits: "0b10011001", dbits: "0b00001001"} +- {xorigin: 15, yorigin: 102, op: "&", dest: 6, xbits: "0b00001111", xbits: "0b01100110", dbits: "0b00000110"} +- {xorigin: -16, yorigin: 0, op: "&", dest: 0, xbits: "0b11110000", xbits: "0b00000000", dbits: "0b00000000"} +- {xorigin: -16, yorigin: 85, op: "&", dest: 80, xbits: "0b11110000", xbits: "0b01010101", dbits: "0b01010000"} +- {xorigin: -16, yorigin: -86, op: "&", dest: -96, xbits: "0b11110000", xbits: "0b10101010", dbits: "0b10100000"} +- {xorigin: -16, yorigin: 15, op: "&", dest: 0, xbits: "0b11110000", xbits: "0b00001111", dbits: "0b00000000"} +- {xorigin: -16, yorigin: -16, op: "&", dest: -16, xbits: "0b11110000", xbits: "0b11110000", dbits: "0b11110000"} +- {xorigin: -16, yorigin: 51, op: "&", dest: 48, xbits: "0b11110000", xbits: "0b00110011", dbits: "0b00110000"} +- {xorigin: -16, yorigin: -52, op: "&", dest: -64, xbits: "0b11110000", xbits: "0b11001100", dbits: "0b11000000"} +- {xorigin: -16, yorigin: -127, op: "&", dest: -128, xbits: "0b11110000", xbits: "0b10000001", dbits: "0b10000000"} +- {xorigin: -16, yorigin: -103, op: "&", dest: -112, xbits: "0b11110000", xbits: "0b10011001", dbits: "0b10010000"} +- {xorigin: -16, yorigin: 102, op: "&", dest: 96, xbits: "0b11110000", xbits: "0b01100110", dbits: "0b01100000"} +- {xorigin: 51, yorigin: 0, op: "&", dest: 0, xbits: "0b00110011", xbits: "0b00000000", dbits: "0b00000000"} +- {xorigin: 51, yorigin: 85, op: "&", dest: 17, xbits: "0b00110011", xbits: "0b01010101", dbits: "0b00010001"} +- {xorigin: 51, yorigin: -86, op: "&", dest: 34, xbits: "0b00110011", xbits: "0b10101010", dbits: "0b00100010"} +- {xorigin: 51, yorigin: 15, op: "&", dest: 3, xbits: "0b00110011", xbits: "0b00001111", dbits: "0b00000011"} +- {xorigin: 51, yorigin: -16, op: "&", dest: 48, xbits: "0b00110011", xbits: "0b11110000", dbits: "0b00110000"} +- {xorigin: 51, yorigin: 51, op: "&", dest: 51, xbits: "0b00110011", xbits: "0b00110011", dbits: "0b00110011"} +- {xorigin: 51, yorigin: -52, op: "&", dest: 0, xbits: "0b00110011", xbits: "0b11001100", dbits: "0b00000000"} +- {xorigin: 51, yorigin: -127, op: "&", dest: 1, xbits: "0b00110011", xbits: "0b10000001", dbits: "0b00000001"} +- {xorigin: 51, yorigin: -103, op: "&", dest: 17, xbits: "0b00110011", xbits: "0b10011001", dbits: "0b00010001"} +- {xorigin: 51, yorigin: 102, op: "&", dest: 34, xbits: "0b00110011", xbits: "0b01100110", dbits: "0b00100010"} +- {xorigin: -52, yorigin: 0, op: "&", dest: 0, xbits: "0b11001100", xbits: "0b00000000", dbits: "0b00000000"} +- {xorigin: -52, yorigin: 85, op: "&", dest: 68, xbits: "0b11001100", xbits: "0b01010101", dbits: "0b01000100"} +- {xorigin: -52, yorigin: -86, op: "&", dest: -120, xbits: "0b11001100", xbits: "0b10101010", dbits: "0b10001000"} +- {xorigin: -52, yorigin: 15, op: "&", dest: 12, xbits: "0b11001100", xbits: "0b00001111", dbits: "0b00001100"} +- {xorigin: -52, yorigin: -16, op: "&", dest: -64, xbits: "0b11001100", xbits: "0b11110000", dbits: "0b11000000"} +- {xorigin: -52, yorigin: 51, op: "&", dest: 0, xbits: "0b11001100", xbits: "0b00110011", dbits: "0b00000000"} +- {xorigin: -52, yorigin: -52, op: "&", dest: -52, xbits: "0b11001100", xbits: "0b11001100", dbits: "0b11001100"} +- {xorigin: -52, yorigin: -127, op: "&", dest: -128, xbits: "0b11001100", xbits: "0b10000001", dbits: "0b10000000"} +- {xorigin: -52, yorigin: -103, op: "&", dest: -120, xbits: "0b11001100", xbits: "0b10011001", dbits: "0b10001000"} +- {xorigin: -52, yorigin: 102, op: "&", dest: 68, xbits: "0b11001100", xbits: "0b01100110", dbits: "0b01000100"} +- {xorigin: -127, yorigin: 0, op: "&", dest: 0, xbits: "0b10000001", xbits: "0b00000000", dbits: "0b00000000"} +- {xorigin: -127, yorigin: 85, op: "&", dest: 1, xbits: "0b10000001", xbits: "0b01010101", dbits: "0b00000001"} +- {xorigin: -127, yorigin: -86, op: "&", dest: -128, xbits: "0b10000001", xbits: "0b10101010", dbits: "0b10000000"} +- {xorigin: -127, yorigin: 15, op: "&", dest: 1, xbits: "0b10000001", xbits: "0b00001111", dbits: "0b00000001"} +- {xorigin: -127, yorigin: -16, op: "&", dest: -128, xbits: "0b10000001", xbits: "0b11110000", dbits: "0b10000000"} +- {xorigin: -127, yorigin: 51, op: "&", dest: 1, xbits: "0b10000001", xbits: "0b00110011", dbits: "0b00000001"} +- {xorigin: -127, yorigin: -52, op: "&", dest: -128, xbits: "0b10000001", xbits: "0b11001100", dbits: "0b10000000"} +- {xorigin: -127, yorigin: -127, op: "&", dest: -127, xbits: "0b10000001", xbits: "0b10000001", dbits: "0b10000001"} +- {xorigin: -127, yorigin: -103, op: "&", dest: -127, xbits: "0b10000001", xbits: "0b10011001", dbits: "0b10000001"} +- {xorigin: -127, yorigin: 102, op: "&", dest: 0, xbits: "0b10000001", xbits: "0b01100110", dbits: "0b00000000"} +- {xorigin: -103, yorigin: 0, op: "&", dest: 0, xbits: "0b10011001", xbits: "0b00000000", dbits: "0b00000000"} +- {xorigin: -103, yorigin: 85, op: "&", dest: 17, xbits: "0b10011001", xbits: "0b01010101", dbits: "0b00010001"} +- {xorigin: -103, yorigin: -86, op: "&", dest: -120, xbits: "0b10011001", xbits: "0b10101010", dbits: "0b10001000"} +- {xorigin: -103, yorigin: 15, op: "&", dest: 9, xbits: "0b10011001", xbits: "0b00001111", dbits: "0b00001001"} +- {xorigin: -103, yorigin: -16, op: "&", dest: -112, xbits: "0b10011001", xbits: "0b11110000", dbits: "0b10010000"} +- {xorigin: -103, yorigin: 51, op: "&", dest: 17, xbits: "0b10011001", xbits: "0b00110011", dbits: "0b00010001"} +- {xorigin: -103, yorigin: -52, op: "&", dest: -120, xbits: "0b10011001", xbits: "0b11001100", dbits: "0b10001000"} +- {xorigin: -103, yorigin: -127, op: "&", dest: -127, xbits: "0b10011001", xbits: "0b10000001", dbits: "0b10000001"} +- {xorigin: -103, yorigin: -103, op: "&", dest: -103, xbits: "0b10011001", xbits: "0b10011001", dbits: "0b10011001"} +- {xorigin: -103, yorigin: 102, op: "&", dest: 0, xbits: "0b10011001", xbits: "0b01100110", dbits: "0b00000000"} +- {xorigin: 102, yorigin: 0, op: "&", dest: 0, xbits: "0b01100110", xbits: "0b00000000", dbits: "0b00000000"} +- {xorigin: 102, yorigin: 85, op: "&", dest: 68, xbits: "0b01100110", xbits: "0b01010101", dbits: "0b01000100"} +- {xorigin: 102, yorigin: -86, op: "&", dest: 34, xbits: "0b01100110", xbits: "0b10101010", dbits: "0b00100010"} +- {xorigin: 102, yorigin: 15, op: "&", dest: 6, xbits: "0b01100110", xbits: "0b00001111", dbits: "0b00000110"} +- {xorigin: 102, yorigin: -16, op: "&", dest: 96, xbits: "0b01100110", xbits: "0b11110000", dbits: "0b01100000"} +- {xorigin: 102, yorigin: 51, op: "&", dest: 34, xbits: "0b01100110", xbits: "0b00110011", dbits: "0b00100010"} +- {xorigin: 102, yorigin: -52, op: "&", dest: 68, xbits: "0b01100110", xbits: "0b11001100", dbits: "0b01000100"} +- {xorigin: 102, yorigin: -127, op: "&", dest: 0, xbits: "0b01100110", xbits: "0b10000001", dbits: "0b00000000"} +- {xorigin: 102, yorigin: -103, op: "&", dest: 0, xbits: "0b01100110", xbits: "0b10011001", dbits: "0b00000000"} +- {xorigin: 102, yorigin: 102, op: "&", dest: 102, xbits: "0b01100110", xbits: "0b01100110", dbits: "0b01100110"} diff --git a/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/list.integer_or.yaml b/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/list.integer_or.yaml new file mode 100644 index 000000000..d592c2765 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/list.integer_or.yaml @@ -0,0 +1,101 @@ +--- # List of integer or "|" operations +- {xorigin: 0, yorigin: 0, op: "|", dest: 0, xbits: "0b00000000", xbits: "0b00000000", dbits: "0b00000000"} +- {xorigin: 0, yorigin: 85, op: "|", dest: 85, xbits: "0b00000000", xbits: "0b01010101", dbits: "0b01010101"} +- {xorigin: 0, yorigin: -86, op: "|", dest: -86, xbits: "0b00000000", xbits: "0b10101010", dbits: "0b10101010"} +- {xorigin: 0, yorigin: 15, op: "|", dest: 15, xbits: "0b00000000", xbits: "0b00001111", dbits: "0b00001111"} +- {xorigin: 0, yorigin: -16, op: "|", dest: -16, xbits: "0b00000000", xbits: "0b11110000", dbits: "0b11110000"} +- {xorigin: 0, yorigin: 51, op: "|", dest: 51, xbits: "0b00000000", xbits: "0b00110011", dbits: "0b00110011"} +- {xorigin: 0, yorigin: -52, op: "|", dest: -52, xbits: "0b00000000", xbits: "0b11001100", dbits: "0b11001100"} +- {xorigin: 0, yorigin: -127, op: "|", dest: -127, xbits: "0b00000000", xbits: "0b10000001", dbits: "0b10000001"} +- {xorigin: 0, yorigin: -103, op: "|", dest: -103, xbits: "0b00000000", xbits: "0b10011001", dbits: "0b10011001"} +- {xorigin: 0, yorigin: 102, op: "|", dest: 102, xbits: "0b00000000", xbits: "0b01100110", dbits: "0b01100110"} +- {xorigin: 85, yorigin: 0, op: "|", dest: 85, xbits: "0b01010101", xbits: "0b00000000", dbits: "0b01010101"} +- {xorigin: 85, yorigin: 85, op: "|", dest: 85, xbits: "0b01010101", xbits: "0b01010101", dbits: "0b01010101"} +- {xorigin: 85, yorigin: -86, op: "|", dest: -1, xbits: "0b01010101", xbits: "0b10101010", dbits: "0b11111111"} +- {xorigin: 85, yorigin: 15, op: "|", dest: 95, xbits: "0b01010101", xbits: "0b00001111", dbits: "0b01011111"} +- {xorigin: 85, yorigin: -16, op: "|", dest: -11, xbits: "0b01010101", xbits: "0b11110000", dbits: "0b11110101"} +- {xorigin: 85, yorigin: 51, op: "|", dest: 119, xbits: "0b01010101", xbits: "0b00110011", dbits: "0b01110111"} +- {xorigin: 85, yorigin: -52, op: "|", dest: -35, xbits: "0b01010101", xbits: "0b11001100", dbits: "0b11011101"} +- {xorigin: 85, yorigin: -127, op: "|", dest: -43, xbits: "0b01010101", xbits: "0b10000001", dbits: "0b11010101"} +- {xorigin: 85, yorigin: -103, op: "|", dest: -35, xbits: "0b01010101", xbits: "0b10011001", dbits: "0b11011101"} +- {xorigin: 85, yorigin: 102, op: "|", dest: 119, xbits: "0b01010101", xbits: "0b01100110", dbits: "0b01110111"} +- {xorigin: -86, yorigin: 0, op: "|", dest: -86, xbits: "0b10101010", xbits: "0b00000000", dbits: "0b10101010"} +- {xorigin: -86, yorigin: 85, op: "|", dest: -1, xbits: "0b10101010", xbits: "0b01010101", dbits: "0b11111111"} +- {xorigin: -86, yorigin: -86, op: "|", dest: -86, xbits: "0b10101010", xbits: "0b10101010", dbits: "0b10101010"} +- {xorigin: -86, yorigin: 15, op: "|", dest: -81, xbits: "0b10101010", xbits: "0b00001111", dbits: "0b10101111"} +- {xorigin: -86, yorigin: -16, op: "|", dest: -6, xbits: "0b10101010", xbits: "0b11110000", dbits: "0b11111010"} +- {xorigin: -86, yorigin: 51, op: "|", dest: -69, xbits: "0b10101010", xbits: "0b00110011", dbits: "0b10111011"} +- {xorigin: -86, yorigin: -52, op: "|", dest: -18, xbits: "0b10101010", xbits: "0b11001100", dbits: "0b11101110"} +- {xorigin: -86, yorigin: -127, op: "|", dest: -85, xbits: "0b10101010", xbits: "0b10000001", dbits: "0b10101011"} +- {xorigin: -86, yorigin: -103, op: "|", dest: -69, xbits: "0b10101010", xbits: "0b10011001", dbits: "0b10111011"} +- {xorigin: -86, yorigin: 102, op: "|", dest: -18, xbits: "0b10101010", xbits: "0b01100110", dbits: "0b11101110"} +- {xorigin: 15, yorigin: 0, op: "|", dest: 15, xbits: "0b00001111", xbits: "0b00000000", dbits: "0b00001111"} +- {xorigin: 15, yorigin: 85, op: "|", dest: 95, xbits: "0b00001111", xbits: "0b01010101", dbits: "0b01011111"} +- {xorigin: 15, yorigin: -86, op: "|", dest: -81, xbits: "0b00001111", xbits: "0b10101010", dbits: "0b10101111"} +- {xorigin: 15, yorigin: 15, op: "|", dest: 15, xbits: "0b00001111", xbits: "0b00001111", dbits: "0b00001111"} +- {xorigin: 15, yorigin: -16, op: "|", dest: -1, xbits: "0b00001111", xbits: "0b11110000", dbits: "0b11111111"} +- {xorigin: 15, yorigin: 51, op: "|", dest: 63, xbits: "0b00001111", xbits: "0b00110011", dbits: "0b00111111"} +- {xorigin: 15, yorigin: -52, op: "|", dest: -49, xbits: "0b00001111", xbits: "0b11001100", dbits: "0b11001111"} +- {xorigin: 15, yorigin: -127, op: "|", dest: -113, xbits: "0b00001111", xbits: "0b10000001", dbits: "0b10001111"} +- {xorigin: 15, yorigin: -103, op: "|", dest: -97, xbits: "0b00001111", xbits: "0b10011001", dbits: "0b10011111"} +- {xorigin: 15, yorigin: 102, op: "|", dest: 111, xbits: "0b00001111", xbits: "0b01100110", dbits: "0b01101111"} +- {xorigin: -16, yorigin: 0, op: "|", dest: -16, xbits: "0b11110000", xbits: "0b00000000", dbits: "0b11110000"} +- {xorigin: -16, yorigin: 85, op: "|", dest: -11, xbits: "0b11110000", xbits: "0b01010101", dbits: "0b11110101"} +- {xorigin: -16, yorigin: -86, op: "|", dest: -6, xbits: "0b11110000", xbits: "0b10101010", dbits: "0b11111010"} +- {xorigin: -16, yorigin: 15, op: "|", dest: -1, xbits: "0b11110000", xbits: "0b00001111", dbits: "0b11111111"} +- {xorigin: -16, yorigin: -16, op: "|", dest: -16, xbits: "0b11110000", xbits: "0b11110000", dbits: "0b11110000"} +- {xorigin: -16, yorigin: 51, op: "|", dest: -13, xbits: "0b11110000", xbits: "0b00110011", dbits: "0b11110011"} +- {xorigin: -16, yorigin: -52, op: "|", dest: -4, xbits: "0b11110000", xbits: "0b11001100", dbits: "0b11111100"} +- {xorigin: -16, yorigin: -127, op: "|", dest: -15, xbits: "0b11110000", xbits: "0b10000001", dbits: "0b11110001"} +- {xorigin: -16, yorigin: -103, op: "|", dest: -7, xbits: "0b11110000", xbits: "0b10011001", dbits: "0b11111001"} +- {xorigin: -16, yorigin: 102, op: "|", dest: -10, xbits: "0b11110000", xbits: "0b01100110", dbits: "0b11110110"} +- {xorigin: 51, yorigin: 0, op: "|", dest: 51, xbits: "0b00110011", xbits: "0b00000000", dbits: "0b00110011"} +- {xorigin: 51, yorigin: 85, op: "|", dest: 119, xbits: "0b00110011", xbits: "0b01010101", dbits: "0b01110111"} +- {xorigin: 51, yorigin: -86, op: "|", dest: -69, xbits: "0b00110011", xbits: "0b10101010", dbits: "0b10111011"} +- {xorigin: 51, yorigin: 15, op: "|", dest: 63, xbits: "0b00110011", xbits: "0b00001111", dbits: "0b00111111"} +- {xorigin: 51, yorigin: -16, op: "|", dest: -13, xbits: "0b00110011", xbits: "0b11110000", dbits: "0b11110011"} +- {xorigin: 51, yorigin: 51, op: "|", dest: 51, xbits: "0b00110011", xbits: "0b00110011", dbits: "0b00110011"} +- {xorigin: 51, yorigin: -52, op: "|", dest: -1, xbits: "0b00110011", xbits: "0b11001100", dbits: "0b11111111"} +- {xorigin: 51, yorigin: -127, op: "|", dest: -77, xbits: "0b00110011", xbits: "0b10000001", dbits: "0b10110011"} +- {xorigin: 51, yorigin: -103, op: "|", dest: -69, xbits: "0b00110011", xbits: "0b10011001", dbits: "0b10111011"} +- {xorigin: 51, yorigin: 102, op: "|", dest: 119, xbits: "0b00110011", xbits: "0b01100110", dbits: "0b01110111"} +- {xorigin: -52, yorigin: 0, op: "|", dest: -52, xbits: "0b11001100", xbits: "0b00000000", dbits: "0b11001100"} +- {xorigin: -52, yorigin: 85, op: "|", dest: -35, xbits: "0b11001100", xbits: "0b01010101", dbits: "0b11011101"} +- {xorigin: -52, yorigin: -86, op: "|", dest: -18, xbits: "0b11001100", xbits: "0b10101010", dbits: "0b11101110"} +- {xorigin: -52, yorigin: 15, op: "|", dest: -49, xbits: "0b11001100", xbits: "0b00001111", dbits: "0b11001111"} +- {xorigin: -52, yorigin: -16, op: "|", dest: -4, xbits: "0b11001100", xbits: "0b11110000", dbits: "0b11111100"} +- {xorigin: -52, yorigin: 51, op: "|", dest: -1, xbits: "0b11001100", xbits: "0b00110011", dbits: "0b11111111"} +- {xorigin: -52, yorigin: -52, op: "|", dest: -52, xbits: "0b11001100", xbits: "0b11001100", dbits: "0b11001100"} +- {xorigin: -52, yorigin: -127, op: "|", dest: -51, xbits: "0b11001100", xbits: "0b10000001", dbits: "0b11001101"} +- {xorigin: -52, yorigin: -103, op: "|", dest: -35, xbits: "0b11001100", xbits: "0b10011001", dbits: "0b11011101"} +- {xorigin: -52, yorigin: 102, op: "|", dest: -18, xbits: "0b11001100", xbits: "0b01100110", dbits: "0b11101110"} +- {xorigin: -127, yorigin: 0, op: "|", dest: -127, xbits: "0b10000001", xbits: "0b00000000", dbits: "0b10000001"} +- {xorigin: -127, yorigin: 85, op: "|", dest: -43, xbits: "0b10000001", xbits: "0b01010101", dbits: "0b11010101"} +- {xorigin: -127, yorigin: -86, op: "|", dest: -85, xbits: "0b10000001", xbits: "0b10101010", dbits: "0b10101011"} +- {xorigin: -127, yorigin: 15, op: "|", dest: -113, xbits: "0b10000001", xbits: "0b00001111", dbits: "0b10001111"} +- {xorigin: -127, yorigin: -16, op: "|", dest: -15, xbits: "0b10000001", xbits: "0b11110000", dbits: "0b11110001"} +- {xorigin: -127, yorigin: 51, op: "|", dest: -77, xbits: "0b10000001", xbits: "0b00110011", dbits: "0b10110011"} +- {xorigin: -127, yorigin: -52, op: "|", dest: -51, xbits: "0b10000001", xbits: "0b11001100", dbits: "0b11001101"} +- {xorigin: -127, yorigin: -127, op: "|", dest: -127, xbits: "0b10000001", xbits: "0b10000001", dbits: "0b10000001"} +- {xorigin: -127, yorigin: -103, op: "|", dest: -103, xbits: "0b10000001", xbits: "0b10011001", dbits: "0b10011001"} +- {xorigin: -127, yorigin: 102, op: "|", dest: -25, xbits: "0b10000001", xbits: "0b01100110", dbits: "0b11100111"} +- {xorigin: -103, yorigin: 0, op: "|", dest: -103, xbits: "0b10011001", xbits: "0b00000000", dbits: "0b10011001"} +- {xorigin: -103, yorigin: 85, op: "|", dest: -35, xbits: "0b10011001", xbits: "0b01010101", dbits: "0b11011101"} +- {xorigin: -103, yorigin: -86, op: "|", dest: -69, xbits: "0b10011001", xbits: "0b10101010", dbits: "0b10111011"} +- {xorigin: -103, yorigin: 15, op: "|", dest: -97, xbits: "0b10011001", xbits: "0b00001111", dbits: "0b10011111"} +- {xorigin: -103, yorigin: -16, op: "|", dest: -7, xbits: "0b10011001", xbits: "0b11110000", dbits: "0b11111001"} +- {xorigin: -103, yorigin: 51, op: "|", dest: -69, xbits: "0b10011001", xbits: "0b00110011", dbits: "0b10111011"} +- {xorigin: -103, yorigin: -52, op: "|", dest: -35, xbits: "0b10011001", xbits: "0b11001100", dbits: "0b11011101"} +- {xorigin: -103, yorigin: -127, op: "|", dest: -103, xbits: "0b10011001", xbits: "0b10000001", dbits: "0b10011001"} +- {xorigin: -103, yorigin: -103, op: "|", dest: -103, xbits: "0b10011001", xbits: "0b10011001", dbits: "0b10011001"} +- {xorigin: -103, yorigin: 102, op: "|", dest: -1, xbits: "0b10011001", xbits: "0b01100110", dbits: "0b11111111"} +- {xorigin: 102, yorigin: 0, op: "|", dest: 102, xbits: "0b01100110", xbits: "0b00000000", dbits: "0b01100110"} +- {xorigin: 102, yorigin: 85, op: "|", dest: 119, xbits: "0b01100110", xbits: "0b01010101", dbits: "0b01110111"} +- {xorigin: 102, yorigin: -86, op: "|", dest: -18, xbits: "0b01100110", xbits: "0b10101010", dbits: "0b11101110"} +- {xorigin: 102, yorigin: 15, op: "|", dest: 111, xbits: "0b01100110", xbits: "0b00001111", dbits: "0b01101111"} +- {xorigin: 102, yorigin: -16, op: "|", dest: -10, xbits: "0b01100110", xbits: "0b11110000", dbits: "0b11110110"} +- {xorigin: 102, yorigin: 51, op: "|", dest: 119, xbits: "0b01100110", xbits: "0b00110011", dbits: "0b01110111"} +- {xorigin: 102, yorigin: -52, op: "|", dest: -18, xbits: "0b01100110", xbits: "0b11001100", dbits: "0b11101110"} +- {xorigin: 102, yorigin: -127, op: "|", dest: -25, xbits: "0b01100110", xbits: "0b10000001", dbits: "0b11100111"} +- {xorigin: 102, yorigin: -103, op: "|", dest: -1, xbits: "0b01100110", xbits: "0b10011001", dbits: "0b11111111"} +- {xorigin: 102, yorigin: 102, op: "|", dest: 102, xbits: "0b01100110", xbits: "0b01100110", dbits: "0b01100110"} diff --git a/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/list.integer_xor.yaml b/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/list.integer_xor.yaml new file mode 100644 index 000000000..c098333e1 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/list.integer_xor.yaml @@ -0,0 +1,101 @@ +--- # List of integer xor "^" operations +- {xorigin: 0, yorigin: 0, op: "^", dest: 0, xbits: "0b00000000", xbits: "0b00000000", dbits: "0b00000000"} +- {xorigin: 0, yorigin: 85, op: "^", dest: 85, xbits: "0b00000000", xbits: "0b01010101", dbits: "0b01010101"} +- {xorigin: 0, yorigin: -86, op: "^", dest: -86, xbits: "0b00000000", xbits: "0b10101010", dbits: "0b10101010"} +- {xorigin: 0, yorigin: 15, op: "^", dest: 15, xbits: "0b00000000", xbits: "0b00001111", dbits: "0b00001111"} +- {xorigin: 0, yorigin: -16, op: "^", dest: -16, xbits: "0b00000000", xbits: "0b11110000", dbits: "0b11110000"} +- {xorigin: 0, yorigin: 51, op: "^", dest: 51, xbits: "0b00000000", xbits: "0b00110011", dbits: "0b00110011"} +- {xorigin: 0, yorigin: -52, op: "^", dest: -52, xbits: "0b00000000", xbits: "0b11001100", dbits: "0b11001100"} +- {xorigin: 0, yorigin: -127, op: "^", dest: -127, xbits: "0b00000000", xbits: "0b10000001", dbits: "0b10000001"} +- {xorigin: 0, yorigin: -103, op: "^", dest: -103, xbits: "0b00000000", xbits: "0b10011001", dbits: "0b10011001"} +- {xorigin: 0, yorigin: 102, op: "^", dest: 102, xbits: "0b00000000", xbits: "0b01100110", dbits: "0b01100110"} +- {xorigin: 85, yorigin: 0, op: "^", dest: 85, xbits: "0b01010101", xbits: "0b00000000", dbits: "0b01010101"} +- {xorigin: 85, yorigin: 85, op: "^", dest: 0, xbits: "0b01010101", xbits: "0b01010101", dbits: "0b00000000"} +- {xorigin: 85, yorigin: -86, op: "^", dest: -1, xbits: "0b01010101", xbits: "0b10101010", dbits: "0b11111111"} +- {xorigin: 85, yorigin: 15, op: "^", dest: 90, xbits: "0b01010101", xbits: "0b00001111", dbits: "0b01011010"} +- {xorigin: 85, yorigin: -16, op: "^", dest: -91, xbits: "0b01010101", xbits: "0b11110000", dbits: "0b10100101"} +- {xorigin: 85, yorigin: 51, op: "^", dest: 102, xbits: "0b01010101", xbits: "0b00110011", dbits: "0b01100110"} +- {xorigin: 85, yorigin: -52, op: "^", dest: -103, xbits: "0b01010101", xbits: "0b11001100", dbits: "0b10011001"} +- {xorigin: 85, yorigin: -127, op: "^", dest: -44, xbits: "0b01010101", xbits: "0b10000001", dbits: "0b11010100"} +- {xorigin: 85, yorigin: -103, op: "^", dest: -52, xbits: "0b01010101", xbits: "0b10011001", dbits: "0b11001100"} +- {xorigin: 85, yorigin: 102, op: "^", dest: 51, xbits: "0b01010101", xbits: "0b01100110", dbits: "0b00110011"} +- {xorigin: -86, yorigin: 0, op: "^", dest: -86, xbits: "0b10101010", xbits: "0b00000000", dbits: "0b10101010"} +- {xorigin: -86, yorigin: 85, op: "^", dest: -1, xbits: "0b10101010", xbits: "0b01010101", dbits: "0b11111111"} +- {xorigin: -86, yorigin: -86, op: "^", dest: 0, xbits: "0b10101010", xbits: "0b10101010", dbits: "0b00000000"} +- {xorigin: -86, yorigin: 15, op: "^", dest: -91, xbits: "0b10101010", xbits: "0b00001111", dbits: "0b10100101"} +- {xorigin: -86, yorigin: -16, op: "^", dest: 90, xbits: "0b10101010", xbits: "0b11110000", dbits: "0b01011010"} +- {xorigin: -86, yorigin: 51, op: "^", dest: -103, xbits: "0b10101010", xbits: "0b00110011", dbits: "0b10011001"} +- {xorigin: -86, yorigin: -52, op: "^", dest: 102, xbits: "0b10101010", xbits: "0b11001100", dbits: "0b01100110"} +- {xorigin: -86, yorigin: -127, op: "^", dest: 43, xbits: "0b10101010", xbits: "0b10000001", dbits: "0b00101011"} +- {xorigin: -86, yorigin: -103, op: "^", dest: 51, xbits: "0b10101010", xbits: "0b10011001", dbits: "0b00110011"} +- {xorigin: -86, yorigin: 102, op: "^", dest: -52, xbits: "0b10101010", xbits: "0b01100110", dbits: "0b11001100"} +- {xorigin: 15, yorigin: 0, op: "^", dest: 15, xbits: "0b00001111", xbits: "0b00000000", dbits: "0b00001111"} +- {xorigin: 15, yorigin: 85, op: "^", dest: 90, xbits: "0b00001111", xbits: "0b01010101", dbits: "0b01011010"} +- {xorigin: 15, yorigin: -86, op: "^", dest: -91, xbits: "0b00001111", xbits: "0b10101010", dbits: "0b10100101"} +- {xorigin: 15, yorigin: 15, op: "^", dest: 0, xbits: "0b00001111", xbits: "0b00001111", dbits: "0b00000000"} +- {xorigin: 15, yorigin: -16, op: "^", dest: -1, xbits: "0b00001111", xbits: "0b11110000", dbits: "0b11111111"} +- {xorigin: 15, yorigin: 51, op: "^", dest: 60, xbits: "0b00001111", xbits: "0b00110011", dbits: "0b00111100"} +- {xorigin: 15, yorigin: -52, op: "^", dest: -61, xbits: "0b00001111", xbits: "0b11001100", dbits: "0b11000011"} +- {xorigin: 15, yorigin: -127, op: "^", dest: -114, xbits: "0b00001111", xbits: "0b10000001", dbits: "0b10001110"} +- {xorigin: 15, yorigin: -103, op: "^", dest: -106, xbits: "0b00001111", xbits: "0b10011001", dbits: "0b10010110"} +- {xorigin: 15, yorigin: 102, op: "^", dest: 105, xbits: "0b00001111", xbits: "0b01100110", dbits: "0b01101001"} +- {xorigin: -16, yorigin: 0, op: "^", dest: -16, xbits: "0b11110000", xbits: "0b00000000", dbits: "0b11110000"} +- {xorigin: -16, yorigin: 85, op: "^", dest: -91, xbits: "0b11110000", xbits: "0b01010101", dbits: "0b10100101"} +- {xorigin: -16, yorigin: -86, op: "^", dest: 90, xbits: "0b11110000", xbits: "0b10101010", dbits: "0b01011010"} +- {xorigin: -16, yorigin: 15, op: "^", dest: -1, xbits: "0b11110000", xbits: "0b00001111", dbits: "0b11111111"} +- {xorigin: -16, yorigin: -16, op: "^", dest: 0, xbits: "0b11110000", xbits: "0b11110000", dbits: "0b00000000"} +- {xorigin: -16, yorigin: 51, op: "^", dest: -61, xbits: "0b11110000", xbits: "0b00110011", dbits: "0b11000011"} +- {xorigin: -16, yorigin: -52, op: "^", dest: 60, xbits: "0b11110000", xbits: "0b11001100", dbits: "0b00111100"} +- {xorigin: -16, yorigin: -127, op: "^", dest: 113, xbits: "0b11110000", xbits: "0b10000001", dbits: "0b01110001"} +- {xorigin: -16, yorigin: -103, op: "^", dest: 105, xbits: "0b11110000", xbits: "0b10011001", dbits: "0b01101001"} +- {xorigin: -16, yorigin: 102, op: "^", dest: -106, xbits: "0b11110000", xbits: "0b01100110", dbits: "0b10010110"} +- {xorigin: 51, yorigin: 0, op: "^", dest: 51, xbits: "0b00110011", xbits: "0b00000000", dbits: "0b00110011"} +- {xorigin: 51, yorigin: 85, op: "^", dest: 102, xbits: "0b00110011", xbits: "0b01010101", dbits: "0b01100110"} +- {xorigin: 51, yorigin: -86, op: "^", dest: -103, xbits: "0b00110011", xbits: "0b10101010", dbits: "0b10011001"} +- {xorigin: 51, yorigin: 15, op: "^", dest: 60, xbits: "0b00110011", xbits: "0b00001111", dbits: "0b00111100"} +- {xorigin: 51, yorigin: -16, op: "^", dest: -61, xbits: "0b00110011", xbits: "0b11110000", dbits: "0b11000011"} +- {xorigin: 51, yorigin: 51, op: "^", dest: 0, xbits: "0b00110011", xbits: "0b00110011", dbits: "0b00000000"} +- {xorigin: 51, yorigin: -52, op: "^", dest: -1, xbits: "0b00110011", xbits: "0b11001100", dbits: "0b11111111"} +- {xorigin: 51, yorigin: -127, op: "^", dest: -78, xbits: "0b00110011", xbits: "0b10000001", dbits: "0b10110010"} +- {xorigin: 51, yorigin: -103, op: "^", dest: -86, xbits: "0b00110011", xbits: "0b10011001", dbits: "0b10101010"} +- {xorigin: 51, yorigin: 102, op: "^", dest: 85, xbits: "0b00110011", xbits: "0b01100110", dbits: "0b01010101"} +- {xorigin: -52, yorigin: 0, op: "^", dest: -52, xbits: "0b11001100", xbits: "0b00000000", dbits: "0b11001100"} +- {xorigin: -52, yorigin: 85, op: "^", dest: -103, xbits: "0b11001100", xbits: "0b01010101", dbits: "0b10011001"} +- {xorigin: -52, yorigin: -86, op: "^", dest: 102, xbits: "0b11001100", xbits: "0b10101010", dbits: "0b01100110"} +- {xorigin: -52, yorigin: 15, op: "^", dest: -61, xbits: "0b11001100", xbits: "0b00001111", dbits: "0b11000011"} +- {xorigin: -52, yorigin: -16, op: "^", dest: 60, xbits: "0b11001100", xbits: "0b11110000", dbits: "0b00111100"} +- {xorigin: -52, yorigin: 51, op: "^", dest: -1, xbits: "0b11001100", xbits: "0b00110011", dbits: "0b11111111"} +- {xorigin: -52, yorigin: -52, op: "^", dest: 0, xbits: "0b11001100", xbits: "0b11001100", dbits: "0b00000000"} +- {xorigin: -52, yorigin: -127, op: "^", dest: 77, xbits: "0b11001100", xbits: "0b10000001", dbits: "0b01001101"} +- {xorigin: -52, yorigin: -103, op: "^", dest: 85, xbits: "0b11001100", xbits: "0b10011001", dbits: "0b01010101"} +- {xorigin: -52, yorigin: 102, op: "^", dest: -86, xbits: "0b11001100", xbits: "0b01100110", dbits: "0b10101010"} +- {xorigin: -127, yorigin: 0, op: "^", dest: -127, xbits: "0b10000001", xbits: "0b00000000", dbits: "0b10000001"} +- {xorigin: -127, yorigin: 85, op: "^", dest: -44, xbits: "0b10000001", xbits: "0b01010101", dbits: "0b11010100"} +- {xorigin: -127, yorigin: -86, op: "^", dest: 43, xbits: "0b10000001", xbits: "0b10101010", dbits: "0b00101011"} +- {xorigin: -127, yorigin: 15, op: "^", dest: -114, xbits: "0b10000001", xbits: "0b00001111", dbits: "0b10001110"} +- {xorigin: -127, yorigin: -16, op: "^", dest: 113, xbits: "0b10000001", xbits: "0b11110000", dbits: "0b01110001"} +- {xorigin: -127, yorigin: 51, op: "^", dest: -78, xbits: "0b10000001", xbits: "0b00110011", dbits: "0b10110010"} +- {xorigin: -127, yorigin: -52, op: "^", dest: 77, xbits: "0b10000001", xbits: "0b11001100", dbits: "0b01001101"} +- {xorigin: -127, yorigin: -127, op: "^", dest: 0, xbits: "0b10000001", xbits: "0b10000001", dbits: "0b00000000"} +- {xorigin: -127, yorigin: -103, op: "^", dest: 24, xbits: "0b10000001", xbits: "0b10011001", dbits: "0b00011000"} +- {xorigin: -127, yorigin: 102, op: "^", dest: -25, xbits: "0b10000001", xbits: "0b01100110", dbits: "0b11100111"} +- {xorigin: -103, yorigin: 0, op: "^", dest: -103, xbits: "0b10011001", xbits: "0b00000000", dbits: "0b10011001"} +- {xorigin: -103, yorigin: 85, op: "^", dest: -52, xbits: "0b10011001", xbits: "0b01010101", dbits: "0b11001100"} +- {xorigin: -103, yorigin: -86, op: "^", dest: 51, xbits: "0b10011001", xbits: "0b10101010", dbits: "0b00110011"} +- {xorigin: -103, yorigin: 15, op: "^", dest: -106, xbits: "0b10011001", xbits: "0b00001111", dbits: "0b10010110"} +- {xorigin: -103, yorigin: -16, op: "^", dest: 105, xbits: "0b10011001", xbits: "0b11110000", dbits: "0b01101001"} +- {xorigin: -103, yorigin: 51, op: "^", dest: -86, xbits: "0b10011001", xbits: "0b00110011", dbits: "0b10101010"} +- {xorigin: -103, yorigin: -52, op: "^", dest: 85, xbits: "0b10011001", xbits: "0b11001100", dbits: "0b01010101"} +- {xorigin: -103, yorigin: -127, op: "^", dest: 24, xbits: "0b10011001", xbits: "0b10000001", dbits: "0b00011000"} +- {xorigin: -103, yorigin: -103, op: "^", dest: 0, xbits: "0b10011001", xbits: "0b10011001", dbits: "0b00000000"} +- {xorigin: -103, yorigin: 102, op: "^", dest: -1, xbits: "0b10011001", xbits: "0b01100110", dbits: "0b11111111"} +- {xorigin: 102, yorigin: 0, op: "^", dest: 102, xbits: "0b01100110", xbits: "0b00000000", dbits: "0b01100110"} +- {xorigin: 102, yorigin: 85, op: "^", dest: 51, xbits: "0b01100110", xbits: "0b01010101", dbits: "0b00110011"} +- {xorigin: 102, yorigin: -86, op: "^", dest: -52, xbits: "0b01100110", xbits: "0b10101010", dbits: "0b11001100"} +- {xorigin: 102, yorigin: 15, op: "^", dest: 105, xbits: "0b01100110", xbits: "0b00001111", dbits: "0b01101001"} +- {xorigin: 102, yorigin: -16, op: "^", dest: -106, xbits: "0b01100110", xbits: "0b11110000", dbits: "0b10010110"} +- {xorigin: 102, yorigin: 51, op: "^", dest: 85, xbits: "0b01100110", xbits: "0b00110011", dbits: "0b01010101"} +- {xorigin: 102, yorigin: -52, op: "^", dest: -86, xbits: "0b01100110", xbits: "0b11001100", dbits: "0b10101010"} +- {xorigin: 102, yorigin: -127, op: "^", dest: -25, xbits: "0b01100110", xbits: "0b10000001", dbits: "0b11100111"} +- {xorigin: 102, yorigin: -103, op: "^", dest: -1, xbits: "0b01100110", xbits: "0b10011001", dbits: "0b11111111"} +- {xorigin: 102, yorigin: 102, op: "^", dest: 0, xbits: "0b01100110", xbits: "0b01100110", dbits: "0b00000000"} diff --git a/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/tbd.large_size_operations.sts b/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/tbd.large_size_operations.sts new file mode 100644 index 000000000..e863c0ab8 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/tbd.large_size_operations.sts @@ -0,0 +1,3 @@ +/*--- +desc: Same checks for values of larger types (short, int, long) +---*/ \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/02.logical_bitwise_operators/list.logical_ops.yaml b/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/02.logical_bitwise_operators/list.logical_ops.yaml new file mode 100644 index 000000000..26fc7d231 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/02.logical_bitwise_operators/list.logical_ops.yaml @@ -0,0 +1,16 @@ +--- # List of logical bitwise operations + +- {xorigin: "false", yorigin: "false", op: "&", dest: "false"} +- {xorigin: "true", yorigin: "false", op: "&", dest: "false"} +- {xorigin: "false", yorigin: "true", op: "&", dest: "false"} +- {xorigin: "true", yorigin: "true", op: "&", dest: "true"} + +- {xorigin: "false", yorigin: "false", op: "|", dest: "false"} +- {xorigin: "true", yorigin: "false", op: "|", dest: "true"} +- {xorigin: "false", yorigin: "true", op: "|", dest: "true"} +- {xorigin: "true", yorigin: "true", op: "|", dest: "true"} + +- {xorigin: "false", yorigin: "false", op: "^", dest: "false"} +- {xorigin: "true", yorigin: "false", op: "^", dest: "true"} +- {xorigin: "false", yorigin: "true", op: "^", dest: "true"} +- {xorigin: "true", yorigin: "true", op: "^", dest: "false"} diff --git a/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/02.logical_bitwise_operators/logical_bitwise_bool.sts b/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/02.logical_bitwise_operators/logical_bitwise_bool.sts new file mode 100644 index 000000000..440f8ba3a --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/02.logical_bitwise_operators/logical_bitwise_bool.sts @@ -0,0 +1,15 @@ +{% for i in logical_ops %} + +/*--- +desc: Bitwise logical operations (boolean) +params: {{.i.xorigin}} {{.i.op}} {{.i.yorigin}} == {{.i.dest}} +---*/ + +function main(): void { + let x: boolean = {{.i.xorigin}}; + let y: boolean = {{.i.yorigin}}; + let dest: boolean = {{.i.dest}}; + assert((x {{.i.op}} y) == dest); +} + +{% endfor %} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/02.logical_bitwise_operators/logical_bitwise_boolean.sts b/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/02.logical_bitwise_operators/logical_bitwise_boolean.sts new file mode 100644 index 000000000..2daec3fa2 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/02.logical_bitwise_operators/logical_bitwise_boolean.sts @@ -0,0 +1,15 @@ +{% for i in logical_ops %} + +/*--- +desc: Bitwise logical operations (Boolean) +params: {{.i.xorigin}} {{.i.op}} {{.i.yorigin}} == {{.i.dest}} +---*/ + +function main(): void { + let x: Boolean = {{.i.xorigin}}; + let y: Boolean = {{.i.yorigin}}; + let dest: Boolean = {{.i.dest}}; + assert((x {{.i.op}} y) == dest); +} + +{% endfor %} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/26.conditional_and_operator/conditional_and_bool.sts b/migrator/test/staticTS/CTS/07.expressions/26.conditional_and_operator/conditional_and_bool.sts new file mode 100644 index 000000000..c08d019fb --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/26.conditional_and_operator/conditional_and_bool.sts @@ -0,0 +1,13 @@ +/*--- +desc: Conditional and operator +---*/ + +function check(): boolean { + assert(false); + return true; +} + +function main(): void { + let x: boolean = false; + assert(!(x && check())); +} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/26.conditional_and_operator/conditional_and_boolean.sts b/migrator/test/staticTS/CTS/07.expressions/26.conditional_and_operator/conditional_and_boolean.sts new file mode 100644 index 000000000..839a18ec0 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/26.conditional_and_operator/conditional_and_boolean.sts @@ -0,0 +1,13 @@ +/*--- +desc: Conditional and operator +---*/ + +function check(): Boolean { + assert(false); + return true; +} + +function main(): void { + let x: Boolean = false; + assert(!(x && check())); +} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/26.conditional_and_operator/tbd.n.conditional_and_bool.sts b/migrator/test/staticTS/CTS/07.expressions/26.conditional_and_operator/tbd.n.conditional_and_bool.sts new file mode 100644 index 000000000..757922248 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/26.conditional_and_operator/tbd.n.conditional_and_bool.sts @@ -0,0 +1,3 @@ +/*--- +desc: Conditional and operator must be applied to boolean arguments only +---*/ \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/27.conditional_or_operator/conditional_or_bool.sts b/migrator/test/staticTS/CTS/07.expressions/27.conditional_or_operator/conditional_or_bool.sts new file mode 100644 index 000000000..812de2f9b --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/27.conditional_or_operator/conditional_or_bool.sts @@ -0,0 +1,13 @@ +/*--- +desc: Conditional or operator +---*/ + +function check(): boolean { + assert(false); + return true; +} + +function main(): void { + let x: boolean = true; + assert(x || check()); +} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/27.conditional_or_operator/conditional_or_boolean.sts b/migrator/test/staticTS/CTS/07.expressions/27.conditional_or_operator/conditional_or_boolean.sts new file mode 100644 index 000000000..4a49fa654 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/27.conditional_or_operator/conditional_or_boolean.sts @@ -0,0 +1,13 @@ +/*--- +desc: Conditional or operator +---*/ + +function check(): Boolean { + assert(false); + return true; +} + +function main(): void { + let x: Boolean = true; + assert(x || check()); +} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/27.conditional_or_operator/tbd.n.conditional_or_bool.sts b/migrator/test/staticTS/CTS/07.expressions/27.conditional_or_operator/tbd.n.conditional_or_bool.sts new file mode 100644 index 000000000..df1ff604f --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/27.conditional_or_operator/tbd.n.conditional_or_bool.sts @@ -0,0 +1,3 @@ +/*--- +desc: Conditional or operator must be applied to boolean arguments only +---*/ \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/29.conditional_expressions/conditional_expression_evaluation.sts b/migrator/test/staticTS/CTS/07.expressions/29.conditional_expressions/conditional_expression_evaluation.sts new file mode 100644 index 000000000..15bc61512 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/29.conditional_expressions/conditional_expression_evaluation.sts @@ -0,0 +1,22 @@ +/*--- +desc: Conditional expression order +---*/ + +function f1(): int { + assert(false); + return 1; +} +function f2(): int { + assert(false); + return 2; +} +function f3(): int { + assert(false); + return 3; +} + +function main(): void { + let cond = false; + let a = cond?f1():cond?f2():cond?f3():0; + assert(a == 0); +} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/29.conditional_expressions/conditional_expression_order.sts b/migrator/test/staticTS/CTS/07.expressions/29.conditional_expressions/conditional_expression_order.sts new file mode 100644 index 000000000..ae22d2c25 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/29.conditional_expressions/conditional_expression_order.sts @@ -0,0 +1,10 @@ +/*--- +desc: Conditional expression order +---*/ + +function main(): void { + let cond = false; + let a = cond?1:cond?2:cond?3:0; + let b = cond?1:(cond?2:(cond?3:0)); + assert(a == b); +} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/08.statements/01.expression_statement/expression_statement.sts b/migrator/test/staticTS/CTS/08.statements/01.expression_statement/expression_statement.sts new file mode 100644 index 000000000..6ec969abb --- /dev/null +++ b/migrator/test/staticTS/CTS/08.statements/01.expression_statement/expression_statement.sts @@ -0,0 +1,13 @@ +{% for item in expression_statements %} + +/*--- +desc: Expression statement +params: > + {{.item.expr}} +---*/ + +function main(): void { + {{.item.expr}}; +} + +{% endfor %} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/08.statements/01.expression_statement/list.expression_statements.yaml b/migrator/test/staticTS/CTS/08.statements/01.expression_statement/list.expression_statements.yaml new file mode 100644 index 000000000..b0fe8b7fc --- /dev/null +++ b/migrator/test/staticTS/CTS/08.statements/01.expression_statement/list.expression_statements.yaml @@ -0,0 +1,6 @@ +--- # List of valid expression statements + +- {expr: "5"} +- {expr: "1 + 2"} +- {expr: "[\"hello\", \"world\"]"} +- {expr: "[]"} diff --git a/migrator/test/staticTS/CTS/08.statements/02.block/block_statement.sts b/migrator/test/staticTS/CTS/08.statements/02.block/block_statement.sts new file mode 100644 index 000000000..4b180a199 --- /dev/null +++ b/migrator/test/staticTS/CTS/08.statements/02.block/block_statement.sts @@ -0,0 +1,15 @@ +{% for item in block_statements %} + +/*--- +desc: Block statement +params: > + {{.item.expr}} +---*/ + +function main(): void { + { + {{.item.expr}}; + } +} + +{% endfor %} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/08.statements/02.block/list.block_statements.yaml b/migrator/test/staticTS/CTS/08.statements/02.block/list.block_statements.yaml new file mode 100644 index 000000000..2b91019c2 --- /dev/null +++ b/migrator/test/staticTS/CTS/08.statements/02.block/list.block_statements.yaml @@ -0,0 +1,8 @@ +--- # List of valid expression statements + +- {expr: "5"} +- {expr: "1 + 2"} +- {expr: "[\"hello\", \"world\"]"} +- {expr: "[]"} +- {expr: "let a: int"} +- {expr: "let b = 1"} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/08.statements/03.labeled_statement/labeled_statement.sts b/migrator/test/staticTS/CTS/08.statements/03.labeled_statement/labeled_statement.sts new file mode 100644 index 000000000..976d22706 --- /dev/null +++ b/migrator/test/staticTS/CTS/08.statements/03.labeled_statement/labeled_statement.sts @@ -0,0 +1,8 @@ +/*--- +desc: Labeled statement +---*/ + +function main(): void { + let x = 0; + lbl: {} +} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/empty_interface_declaration.sts b/migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/empty_interface_declaration.sts new file mode 100644 index 000000000..be3170492 --- /dev/null +++ b/migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/empty_interface_declaration.sts @@ -0,0 +1,15 @@ +{% for id in identifiers %} +{% for static in ["", "static"] %} +{% for ancestors in identifiers_list %} + +/*--- +desc: Empty interface declaration without type parameters +params: {{.static}} interface {{.id}} extends {{.ancestors}}{} +---*/ + +{{.static}} interface {{.id}} extends {{.ancestors}}{} +function main(): void {} + +{% endfor %} +{% endfor %} +{% endfor %} diff --git a/migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/empty_interface_declaration_with_type_params.sts b/migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/empty_interface_declaration_with_type_params.sts new file mode 100644 index 000000000..cb1995da3 --- /dev/null +++ b/migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/empty_interface_declaration_with_type_params.sts @@ -0,0 +1,15 @@ +{% for id in identifiers %} +{% for static in ["", "static"] %} +{% for params in identifiers_list %} + +/*--- +desc: Empty interface declaration with type parameters +params: {{.static}} interface {{.id}}<{{.params}}>{} +---*/ + +{{.static}} interface {{.id}}<{{.params}}>{} +function main(): void {} + +{% endfor %} +{% endfor %} +{% endfor %} diff --git a/migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/interface_fields.sts b/migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/interface_fields.sts new file mode 100644 index 000000000..4468ec166 --- /dev/null +++ b/migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/interface_fields.sts @@ -0,0 +1,14 @@ +{% for id in identifiers %} +{% for item in default_value %} + +/*--- +desc: Interface fields with specified types +params: "{{.id}}: {{.item.type}} = {{.item.value}}" +---*/ + +interface Name { + {{.id}}: {{.item.type}} = {{.item.value}}; +} + +{% endfor %} +{% endfor %} diff --git a/migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/interface_fields_without_types.sts b/migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/interface_fields_without_types.sts new file mode 100644 index 000000000..139a0b27a --- /dev/null +++ b/migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/interface_fields_without_types.sts @@ -0,0 +1,14 @@ +{% for id in identifiers %} +{% for item in default_value %} + +/*--- +desc: Interface fields without types +params: "{{.id}} = {{.item.value}}" +---*/ + +interface Name { + {{.id}} = {{.item.value}}; +} + +{% endfor %} +{% endfor %} diff --git a/migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/list.default_value.yaml b/migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/list.default_value.yaml new file mode 100644 index 000000000..9ffc292f9 --- /dev/null +++ b/migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/list.default_value.yaml @@ -0,0 +1,10 @@ +--- # List of default values for primitive types + +- {type: byte, value: 0} +- {type: short, value: 0} +- {type: int, value: 0} +- {type: long, value: 0} +- {type: float, value: 0.0} +- {type: double, value: 0.0} +- {type: char, value: '\u0000'} +- {type: boolean, value: false} diff --git a/migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/list.identifiers.yaml b/migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/list.identifiers.yaml new file mode 100644 index 000000000..ab7ecdcdc --- /dev/null +++ b/migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/list.identifiers.yaml @@ -0,0 +1,8 @@ +--- # List of identifiers + +- debug +- test +- main +- x +- y +- z diff --git a/migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/list.identifiers_list.yaml b/migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/list.identifiers_list.yaml new file mode 100644 index 000000000..0b4dd3b2d --- /dev/null +++ b/migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/list.identifiers_list.yaml @@ -0,0 +1,6 @@ +--- # List containing comma separated identifiers + +- A +- A, B +- A, B, C +- A, B, C, D diff --git a/migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/n.interface_extends_without_type.sts b/migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/n.interface_extends_without_type.sts new file mode 100644 index 000000000..c9e86e0d2 --- /dev/null +++ b/migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/n.interface_extends_without_type.sts @@ -0,0 +1,5 @@ +/*--- +desc: Inteface extends must be followed by a type +---*/ + +interface Name extends {} diff --git a/migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/several_interface_fields.sts b/migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/several_interface_fields.sts new file mode 100644 index 000000000..86fd9ac2c --- /dev/null +++ b/migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/several_interface_fields.sts @@ -0,0 +1,9 @@ +/*--- +desc: Several interface fields at the same time +---*/ + +interface Name { +{% for item in default_value %} + {{.item.type}}Field: {{.item.type}} = {{.item.value}}; +{% endfor %} +} diff --git a/migrator/test/staticTS/CTS/11.enums/01.enum_constants/any_number_of_constants.sts b/migrator/test/staticTS/CTS/11.enums/01.enum_constants/any_number_of_constants.sts new file mode 100644 index 000000000..fed57f69b --- /dev/null +++ b/migrator/test/staticTS/CTS/11.enums/01.enum_constants/any_number_of_constants.sts @@ -0,0 +1,14 @@ +{% for i in range(100, 1000, 100) %} + +/*--- +desc: Enum must support any number of constants +params: number of consts = {{.i}} +---*/ + +enum GeneratedEnum { +{% for length in range (1, i) -%} + {% for _ in range(length) %}A{% endfor %}{% if length is lt(i - 1)%},{% endif %} +{% endfor %} +} + +{%- endfor %} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/11.enums/01.enum_constants/list.identifiers.yaml b/migrator/test/staticTS/CTS/11.enums/01.enum_constants/list.identifiers.yaml new file mode 100644 index 000000000..ab7ecdcdc --- /dev/null +++ b/migrator/test/staticTS/CTS/11.enums/01.enum_constants/list.identifiers.yaml @@ -0,0 +1,8 @@ +--- # List of identifiers + +- debug +- test +- main +- x +- y +- z diff --git a/migrator/test/staticTS/CTS/11.enums/01.enum_constants/n.empty_enum.sts b/migrator/test/staticTS/CTS/11.enums/01.enum_constants/n.empty_enum.sts new file mode 100644 index 000000000..2eb3f73b9 --- /dev/null +++ b/migrator/test/staticTS/CTS/11.enums/01.enum_constants/n.empty_enum.sts @@ -0,0 +1,6 @@ +/*--- +desc: A enum must have at least one enum constant +---*/ + +enum EmptyEnum {} + diff --git a/migrator/test/staticTS/CTS/11.enums/01.enum_constants/n.repeating_constants.sts b/migrator/test/staticTS/CTS/11.enums/01.enum_constants/n.repeating_constants.sts new file mode 100644 index 000000000..62f77fdc2 --- /dev/null +++ b/migrator/test/staticTS/CTS/11.enums/01.enum_constants/n.repeating_constants.sts @@ -0,0 +1,9 @@ +/*--- +desc: Enum cannot have two constants with equal names +---*/ + +enum Colors { + Red, + {% for id in identifiers %} {{.id}} {% endfor %} + Red +} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/11.enums/01.enum_constants/n.trailing_comma_enum.sts b/migrator/test/staticTS/CTS/11.enums/01.enum_constants/n.trailing_comma_enum.sts new file mode 100644 index 000000000..bd252e8c7 --- /dev/null +++ b/migrator/test/staticTS/CTS/11.enums/01.enum_constants/n.trailing_comma_enum.sts @@ -0,0 +1,9 @@ +/*--- +desc: Trailing commas are not allowed in enum constant lists +---*/ + +enum Colors { + Red, + Green, + Blue, +} diff --git a/migrator/test/staticTS/CTS/11.enums/01.enum_constants/simple_enum.sts b/migrator/test/staticTS/CTS/11.enums/01.enum_constants/simple_enum.sts new file mode 100644 index 000000000..984f71d8a --- /dev/null +++ b/migrator/test/staticTS/CTS/11.enums/01.enum_constants/simple_enum.sts @@ -0,0 +1,9 @@ +/*--- +desc: Simple enum +---*/ + +enum Colors { + Red, + Green, + Blue +} diff --git a/migrator/test/staticTS/CTS/11.enums/03.enum_constant_methods/enum_constant_ordinals.sts b/migrator/test/staticTS/CTS/11.enums/03.enum_constant_methods/enum_constant_ordinals.sts new file mode 100644 index 000000000..874489519 --- /dev/null +++ b/migrator/test/staticTS/CTS/11.enums/03.enum_constant_methods/enum_constant_ordinals.sts @@ -0,0 +1,15 @@ +/*--- +desc: Enum constant should have an ordinal() method returning its index starting from 0 +---*/ + +enum GeneratedEnum { +{% for length in range(1, 10) -%} + {% for _ in range(length) %}A{% endfor %}{% if length is lt(9)%},{% endif %} +{% endfor %} +} + +function main(): void { +{% for i in range(0, 9) %} + assert(GeneratedEnum.{% for _ in range(i + 1)%}A{% endfor %}.ordinal() == {{.i}}); +{%- endfor %} +} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/11.enums/03.enum_constant_methods/enum_constant_to_string.sts b/migrator/test/staticTS/CTS/11.enums/03.enum_constant_methods/enum_constant_to_string.sts new file mode 100644 index 000000000..09a109f09 --- /dev/null +++ b/migrator/test/staticTS/CTS/11.enums/03.enum_constant_methods/enum_constant_to_string.sts @@ -0,0 +1,15 @@ +/*--- +desc: Enum constant should have an toString() method returning its name +---*/ + +enum GeneratedEnum { +{% for length in range(1, 10) -%} + {% for _ in range(length) %}A{% endfor %}{% if length is lt(9)%},{% endif %} +{% endfor %} +} + +function main(): void { +{% for i in range(0, 9) %} + assert(GeneratedEnum.{% for _ in range(i + 1)%}A{% endfor %}.toString() == "{% for _ in range(i + 1)%}A{% endfor %}"); +{%- endfor %} +} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/13.packages/02.import_declarations/import.sts b/migrator/test/staticTS/CTS/13.packages/02.import_declarations/import.sts new file mode 100644 index 000000000..238b9f4c3 --- /dev/null +++ b/migrator/test/staticTS/CTS/13.packages/02.import_declarations/import.sts @@ -0,0 +1,11 @@ +{% for name in qualified_names %} + +/*--- +desc: Import declaration without 'as' like 'import a.b.c.d' or 'import a.b.c.*'; +params: qualified name = {{.name}} +---*/ + +import {{.name}}; +import {{.name}}.*; + +{% endfor %} diff --git a/migrator/test/staticTS/CTS/13.packages/02.import_declarations/import_as.sts b/migrator/test/staticTS/CTS/13.packages/02.import_declarations/import_as.sts new file mode 100644 index 000000000..031d250d4 --- /dev/null +++ b/migrator/test/staticTS/CTS/13.packages/02.import_declarations/import_as.sts @@ -0,0 +1,11 @@ +{% for name in qualified_names %} +{% for id in words %} +/*--- +desc: Import declaration with 'as' like 'import a.b.c.d as name' +params: qualified name = {{.name}}, identifier = {{.id}} +---*/ + +import {{.name}} as {{.id}}; + +{% endfor %} +{% endfor %} diff --git a/migrator/test/staticTS/CTS/13.packages/02.import_declarations/list.qualified_names.yaml b/migrator/test/staticTS/CTS/13.packages/02.import_declarations/list.qualified_names.yaml new file mode 100644 index 000000000..7432a843f --- /dev/null +++ b/migrator/test/staticTS/CTS/13.packages/02.import_declarations/list.qualified_names.yaml @@ -0,0 +1,6 @@ +--- # List of qualified names + +- A.B.C +- java.lang.String +- A.B.C.D.R +- java.concurrency.BlockingQueue diff --git a/migrator/test/staticTS/CTS/13.packages/02.import_declarations/list.words.yaml b/migrator/test/staticTS/CTS/13.packages/02.import_declarations/list.words.yaml new file mode 100644 index 000000000..cc2d8e915 --- /dev/null +++ b/migrator/test/staticTS/CTS/13.packages/02.import_declarations/list.words.yaml @@ -0,0 +1,8 @@ +--- # List of simple words that can be used as an identifier + +- "yes" +- "no" +- x +- xx +- y +- identifier diff --git a/migrator/test/staticTS/CTS/13.packages/02.import_declarations/n.import_all_as.sts b/migrator/test/staticTS/CTS/13.packages/02.import_declarations/n.import_all_as.sts new file mode 100644 index 000000000..c04038ab3 --- /dev/null +++ b/migrator/test/staticTS/CTS/13.packages/02.import_declarations/n.import_all_as.sts @@ -0,0 +1,11 @@ +{% for name in qualified_names %} +{% for id in words %} +/*--- +desc: In import declaration usage of '*' and 'as' simultaneously is prohibited +params: qualified name = {{.name}}, identifier = {{.id}} +---*/ + +import {{.name}}.* as {{.id}}; + +{% endfor %} +{% endfor %} diff --git a/migrator/test/staticTS/CTS/13.packages/05.export_declarations/export_declarations.sts b/migrator/test/staticTS/CTS/13.packages/05.export_declarations/export_declarations.sts new file mode 100644 index 000000000..bd832f962 --- /dev/null +++ b/migrator/test/staticTS/CTS/13.packages/05.export_declarations/export_declarations.sts @@ -0,0 +1,12 @@ +{% for decl in toplevel_declarations %} + +/*--- +desc: \'export\' keyword can be added to any toplevel declaration +params: | + {{.decl}} +---*/ + +export {{.decl}} +function main(): void {} + +{%- endfor %} diff --git a/migrator/test/staticTS/CTS/13.packages/05.export_declarations/list.grouped_declarations.yaml b/migrator/test/staticTS/CTS/13.packages/05.export_declarations/list.grouped_declarations.yaml new file mode 100644 index 000000000..c23f924f4 --- /dev/null +++ b/migrator/test/staticTS/CTS/13.packages/05.export_declarations/list.grouped_declarations.yaml @@ -0,0 +1,5 @@ +--- # List of declarations, grouped into list. These cannot be used as toplevel declarations + +- "let c = 1, b = 2;" +- "let c: int = 2, b = 1.0, z = \"hello\";" +- "const a: int = 1, b = \"a string\";" diff --git a/migrator/test/staticTS/CTS/13.packages/05.export_declarations/list.toplevel_declarations.yaml b/migrator/test/staticTS/CTS/13.packages/05.export_declarations/list.toplevel_declarations.yaml new file mode 100644 index 000000000..c0cb417eb --- /dev/null +++ b/migrator/test/staticTS/CTS/13.packages/05.export_declarations/list.toplevel_declarations.yaml @@ -0,0 +1,21 @@ +--- # List of toplevel declarations + +- "class Point {}" +- "interface A {}" +- "enum Enum { v1, v2 }" + +# Variable declarations + +- "let origin = 1;" +- "let i: int = 1;" +- "let b: byte;" + +# Constant declarations + +- "const b = 1;" +- "const s = \"str\";" +- "const a: int = 1;" + +# Function declarations + +- "function dist(x: int, y: int): void {}" diff --git a/migrator/test/staticTS/CTS/13.packages/05.export_declarations/n.exported_grouped_declarations.sts b/migrator/test/staticTS/CTS/13.packages/05.export_declarations/n.exported_grouped_declarations.sts new file mode 100644 index 000000000..4ac879a76 --- /dev/null +++ b/migrator/test/staticTS/CTS/13.packages/05.export_declarations/n.exported_grouped_declarations.sts @@ -0,0 +1,12 @@ +{% for decl in grouped_declarations %} + +/*--- +desc: Grouped declarations cannot be exported +params: | + {{.decl}} +---*/ + +export {{.decl}} +function main(): void {} + +{%- endfor %} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/13.packages/06.program_entry_point/list.identifiers.yaml b/migrator/test/staticTS/CTS/13.packages/06.program_entry_point/list.identifiers.yaml new file mode 100644 index 000000000..ab7ecdcdc --- /dev/null +++ b/migrator/test/staticTS/CTS/13.packages/06.program_entry_point/list.identifiers.yaml @@ -0,0 +1,8 @@ +--- # List of identifiers + +- debug +- test +- main +- x +- y +- z diff --git a/migrator/test/staticTS/CTS/13.packages/06.program_entry_point/multiple_entrypoints.sts b/migrator/test/staticTS/CTS/13.packages/06.program_entry_point/multiple_entrypoints.sts new file mode 100644 index 000000000..cf7b3080c --- /dev/null +++ b/migrator/test/staticTS/CTS/13.packages/06.program_entry_point/multiple_entrypoints.sts @@ -0,0 +1,13 @@ +/*--- +desc: Multiple entrypoints with different names +---*/ + +package test; + +function main(): void {} + +{% for id in identifiers %} + +function main${{.id}}(): void {} + +{%- endfor %} \ No newline at end of file -- Gitee From 17bea9470baa68fa52290af10b6b9c0bcd0cc762 Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Thu, 11 Aug 2022 17:19:30 +0300 Subject: [PATCH 08/84] Add token tests --- .../02.tokens/01.whitespaces/whitespaces.sts | 9 +++++++++ .../02.line_separators/line_separators.sts | 17 +++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 migrator/test/staticTS/CTS/02.lexical_elements/02.tokens/01.whitespaces/whitespaces.sts create mode 100644 migrator/test/staticTS/CTS/02.lexical_elements/02.tokens/02.line_separators/line_separators.sts diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/02.tokens/01.whitespaces/whitespaces.sts b/migrator/test/staticTS/CTS/02.lexical_elements/02.tokens/01.whitespaces/whitespaces.sts new file mode 100644 index 000000000..ee8b905a5 --- /dev/null +++ b/migrator/test/staticTS/CTS/02.lexical_elements/02.tokens/01.whitespaces/whitespaces.sts @@ -0,0 +1,9 @@ +/*--- +desc: Whitespaces +---*/ +// PLEASE DO NOT EDIT! +// THIS FILE CONSTRUCTED WITH WHITESPACES FROM 2.2.1 +// \U+0020 function \U+0009 main ( \U+000B ) : \U+000C void \U+00A0 { \U+FEFF } + + function main( ): void +{} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/02.tokens/02.line_separators/line_separators.sts b/migrator/test/staticTS/CTS/02.lexical_elements/02.tokens/02.line_separators/line_separators.sts new file mode 100644 index 000000000..4ad07c806 --- /dev/null +++ b/migrator/test/staticTS/CTS/02.lexical_elements/02.tokens/02.line_separators/line_separators.sts @@ -0,0 +1,17 @@ +/*--- +desc: Line separators +---*/ + +// PLEASE DO NOT EDIT! +// THIS FILE IS CONSTRUCTED WITH LINE SEPARATORS FROM 2.2.2 +// function main(): void { +// \U+000A +// \U+000D +// \U+000D \U+000A +// \U+2028 +// \U+2029 +//} + +function main(): void { + +

} \ No newline at end of file -- Gitee From cf92bab100b339b8d73ea2ad96c778d022279b1a Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Mon, 15 Aug 2022 17:18:49 +0300 Subject: [PATCH 09/84] Add local declarations tests --- .../04.local_declarations/local_class.sts | 9 +++++++++ .../04.local_declarations/local_const.sts | 8 ++++++++ .../04.local_declarations/local_var.sts | 8 ++++++++ .../04.local_declarations/n.local_class.sts | 12 ++++++++++++ .../04.local_declarations/n.local_const.sts | 11 +++++++++++ .../04.local_declarations/n.local_var.sts | 11 +++++++++++ 6 files changed, 59 insertions(+) create mode 100644 migrator/test/staticTS/CTS/08.statements/04.local_declarations/local_class.sts create mode 100644 migrator/test/staticTS/CTS/08.statements/04.local_declarations/local_const.sts create mode 100644 migrator/test/staticTS/CTS/08.statements/04.local_declarations/local_var.sts create mode 100644 migrator/test/staticTS/CTS/08.statements/04.local_declarations/n.local_class.sts create mode 100644 migrator/test/staticTS/CTS/08.statements/04.local_declarations/n.local_const.sts create mode 100644 migrator/test/staticTS/CTS/08.statements/04.local_declarations/n.local_var.sts diff --git a/migrator/test/staticTS/CTS/08.statements/04.local_declarations/local_class.sts b/migrator/test/staticTS/CTS/08.statements/04.local_declarations/local_class.sts new file mode 100644 index 000000000..3359b80f5 --- /dev/null +++ b/migrator/test/staticTS/CTS/08.statements/04.local_declarations/local_class.sts @@ -0,0 +1,9 @@ +/*--- +desc: Local declaration in statement (const) +---*/ + +function main(): void { + class A {} + let a: A = new A; + assert(a != null); +} diff --git a/migrator/test/staticTS/CTS/08.statements/04.local_declarations/local_const.sts b/migrator/test/staticTS/CTS/08.statements/04.local_declarations/local_const.sts new file mode 100644 index 000000000..8ce8d2866 --- /dev/null +++ b/migrator/test/staticTS/CTS/08.statements/04.local_declarations/local_const.sts @@ -0,0 +1,8 @@ +/*--- +desc: Local declaration in statement (const) +---*/ + +function main(): void { + const a: int = 0; + assert(a == 0); +} diff --git a/migrator/test/staticTS/CTS/08.statements/04.local_declarations/local_var.sts b/migrator/test/staticTS/CTS/08.statements/04.local_declarations/local_var.sts new file mode 100644 index 000000000..5e95cd63b --- /dev/null +++ b/migrator/test/staticTS/CTS/08.statements/04.local_declarations/local_var.sts @@ -0,0 +1,8 @@ +/*--- +desc: Local declaration in statement (var) +---*/ + +function main(): void { + let a: int = 0; + assert(a == 0); +} diff --git a/migrator/test/staticTS/CTS/08.statements/04.local_declarations/n.local_class.sts b/migrator/test/staticTS/CTS/08.statements/04.local_declarations/n.local_class.sts new file mode 100644 index 000000000..3a7421c0e --- /dev/null +++ b/migrator/test/staticTS/CTS/08.statements/04.local_declarations/n.local_class.sts @@ -0,0 +1,12 @@ +/*--- +desc: Local declaration in statement (const) +---*/ + +function main(): void { + { + class A {} + let a: A = new A; + assert(a != null); + } + assert(a != null); +} diff --git a/migrator/test/staticTS/CTS/08.statements/04.local_declarations/n.local_const.sts b/migrator/test/staticTS/CTS/08.statements/04.local_declarations/n.local_const.sts new file mode 100644 index 000000000..f435cf1da --- /dev/null +++ b/migrator/test/staticTS/CTS/08.statements/04.local_declarations/n.local_const.sts @@ -0,0 +1,11 @@ +/*--- +desc: Local declaration in statement (const) +---*/ + +function main(): void { + { + const a: int = 0; + assert(a == 0); + } + assert(a == 0); +} diff --git a/migrator/test/staticTS/CTS/08.statements/04.local_declarations/n.local_var.sts b/migrator/test/staticTS/CTS/08.statements/04.local_declarations/n.local_var.sts new file mode 100644 index 000000000..e69e64e9a --- /dev/null +++ b/migrator/test/staticTS/CTS/08.statements/04.local_declarations/n.local_var.sts @@ -0,0 +1,11 @@ +/*--- +desc: Local declaration in statement (var) +---*/ + +function main(): void { + { + let a: int = 0; + assert(a == 0); + } + assert(a == 0); +} -- Gitee From 609839e28029e79a83aa85f8e5597576969e30c0 Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Mon, 15 Aug 2022 17:26:09 +0300 Subject: [PATCH 10/84] Add while and do statement tests --- .../08.statements/06.while_and_do_statements/do.sts | 12 ++++++++++++ .../06.while_and_do_statements/while.sts | 11 +++++++++++ .../while_not_executed.sts | 9 +++++++++ 3 files changed, 32 insertions(+) create mode 100644 migrator/test/staticTS/CTS/08.statements/06.while_and_do_statements/do.sts create mode 100644 migrator/test/staticTS/CTS/08.statements/06.while_and_do_statements/while.sts create mode 100644 migrator/test/staticTS/CTS/08.statements/06.while_and_do_statements/while_not_executed.sts diff --git a/migrator/test/staticTS/CTS/08.statements/06.while_and_do_statements/do.sts b/migrator/test/staticTS/CTS/08.statements/06.while_and_do_statements/do.sts new file mode 100644 index 000000000..43e51ea42 --- /dev/null +++ b/migrator/test/staticTS/CTS/08.statements/06.while_and_do_statements/do.sts @@ -0,0 +1,12 @@ +/*--- +desc: While statement +---*/ + +function main(): void { + let i = 1; + do { + i--; + } while (i > 0); + + assert(i == 0); +} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/08.statements/06.while_and_do_statements/while.sts b/migrator/test/staticTS/CTS/08.statements/06.while_and_do_statements/while.sts new file mode 100644 index 000000000..9c6327255 --- /dev/null +++ b/migrator/test/staticTS/CTS/08.statements/06.while_and_do_statements/while.sts @@ -0,0 +1,11 @@ +/*--- +desc: While statement +---*/ + +function main(): void { + let i = 1; + while (i > 0) { + i--; + } + assert(i == 0); +} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/08.statements/06.while_and_do_statements/while_not_executed.sts b/migrator/test/staticTS/CTS/08.statements/06.while_and_do_statements/while_not_executed.sts new file mode 100644 index 000000000..bffcfe770 --- /dev/null +++ b/migrator/test/staticTS/CTS/08.statements/06.while_and_do_statements/while_not_executed.sts @@ -0,0 +1,9 @@ +/*--- +desc: While statement (not executed) +---*/ + +function main(): void { + while (false) { + assert(false); + } +} \ No newline at end of file -- Gitee From 551f042e8ea0c85d0e87db2caba52f77da863176 Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Mon, 15 Aug 2022 17:30:06 +0300 Subject: [PATCH 11/84] Add break statement test --- .../CTS/08.statements/09.break_statement/break.sts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 migrator/test/staticTS/CTS/08.statements/09.break_statement/break.sts diff --git a/migrator/test/staticTS/CTS/08.statements/09.break_statement/break.sts b/migrator/test/staticTS/CTS/08.statements/09.break_statement/break.sts new file mode 100644 index 000000000..9f75bd89c --- /dev/null +++ b/migrator/test/staticTS/CTS/08.statements/09.break_statement/break.sts @@ -0,0 +1,14 @@ +/*--- +desc: Break statement +---*/ + +function main(): void { + let i = 2; + + while (i > 0) { + break; + i--; + } + + assert(i == 2); +} \ No newline at end of file -- Gitee From 26c8fa3353d0e8892e9eed8b512590a41b72e9af Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Mon, 15 Aug 2022 17:31:35 +0300 Subject: [PATCH 12/84] Add return statement test --- .../CTS/08.statements/11.return_statement/return.sts | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 migrator/test/staticTS/CTS/08.statements/11.return_statement/return.sts diff --git a/migrator/test/staticTS/CTS/08.statements/11.return_statement/return.sts b/migrator/test/staticTS/CTS/08.statements/11.return_statement/return.sts new file mode 100644 index 000000000..67395b2bf --- /dev/null +++ b/migrator/test/staticTS/CTS/08.statements/11.return_statement/return.sts @@ -0,0 +1,9 @@ +/*--- +desc: Return statement +---*/ + +function main(): void { + return; + + assert(false); +} \ No newline at end of file -- Gitee From 5a1ea742275a498fd02e97a63a29fb912304fa91 Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Mon, 15 Aug 2022 17:34:27 +0300 Subject: [PATCH 13/84] Add assert statement tests --- .../CTS/08.statements/13.assert_statement/assert.sts | 7 +++++++ .../CTS/08.statements/13.assert_statement/n.assert.sts | 7 +++++++ .../CTS/08.statements/13.assert_statement/n.assert_str.sts | 7 +++++++ 3 files changed, 21 insertions(+) create mode 100644 migrator/test/staticTS/CTS/08.statements/13.assert_statement/assert.sts create mode 100644 migrator/test/staticTS/CTS/08.statements/13.assert_statement/n.assert.sts create mode 100644 migrator/test/staticTS/CTS/08.statements/13.assert_statement/n.assert_str.sts diff --git a/migrator/test/staticTS/CTS/08.statements/13.assert_statement/assert.sts b/migrator/test/staticTS/CTS/08.statements/13.assert_statement/assert.sts new file mode 100644 index 000000000..c515b20eb --- /dev/null +++ b/migrator/test/staticTS/CTS/08.statements/13.assert_statement/assert.sts @@ -0,0 +1,7 @@ +/* +desc: Assert statement +*/ + +function main(): void { + assert(true); +} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/08.statements/13.assert_statement/n.assert.sts b/migrator/test/staticTS/CTS/08.statements/13.assert_statement/n.assert.sts new file mode 100644 index 000000000..0fce1ed38 --- /dev/null +++ b/migrator/test/staticTS/CTS/08.statements/13.assert_statement/n.assert.sts @@ -0,0 +1,7 @@ +/* +desc: Assert statement (failed) +*/ + +function main(): void { + assert(false); +} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/08.statements/13.assert_statement/n.assert_str.sts b/migrator/test/staticTS/CTS/08.statements/13.assert_statement/n.assert_str.sts new file mode 100644 index 000000000..6ef4b7c8a --- /dev/null +++ b/migrator/test/staticTS/CTS/08.statements/13.assert_statement/n.assert_str.sts @@ -0,0 +1,7 @@ +/* +desc: Assert statement (failed) +*/ + +function main(): void { + assert(false, "Assert failed"); +} \ No newline at end of file -- Gitee From 002d289d922199cc53c19d7cf379f943b44de358 Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Tue, 16 Aug 2022 12:09:25 +0300 Subject: [PATCH 14/84] Add zero width characters --- migrator/src/com/ohos/migrator/staticTS/parser/StaticTSLexer.g4 | 1 + 1 file changed, 1 insertion(+) diff --git a/migrator/src/com/ohos/migrator/staticTS/parser/StaticTSLexer.g4 b/migrator/src/com/ohos/migrator/staticTS/parser/StaticTSLexer.g4 index b0ba23ccc..f5ada6b17 100644 --- a/migrator/src/com/ohos/migrator/staticTS/parser/StaticTSLexer.g4 +++ b/migrator/src/com/ohos/migrator/staticTS/parser/StaticTSLexer.g4 @@ -265,6 +265,7 @@ fragment ExponentPart fragment IdentifierPart : [\p{ID_Continue}] | '$' + | [\u200C\u200D] | '\\' UnicodeEscapeSequence ; -- Gitee From 32a121a7f688bf9924513c7b68e56955c65158f6 Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Tue, 16 Aug 2022 12:10:10 +0300 Subject: [PATCH 15/84] Make script text consistent with other lines --- migrator/test/staticTS/formatChecker/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migrator/test/staticTS/formatChecker/README.md b/migrator/test/staticTS/formatChecker/README.md index 864eefce2..6d9cb1564 100644 --- a/migrator/test/staticTS/formatChecker/README.md +++ b/migrator/test/staticTS/formatChecker/README.md @@ -17,7 +17,7 @@ In `Format Checker` we try to stabilize this format by implementing a Proof of C 3. Build migration tool: at project root run `ant build` -4. Run tests: `python3 formatChecker/run_tests.py ~/formatCheker/output /path/to/migration-tool.jar` +4. Run tests: `python3 formatChecker/run_tests.py ./formatChecker/output ../../out/migrator-0.1.jar` 5. Get coverage: `python3 formatChecker/coverage.py ./formatChecker/output` -- Gitee From b3cf0b7ab0e341f79bf1aa0b798452c3d944a284 Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Tue, 16 Aug 2022 12:10:50 +0300 Subject: [PATCH 16/84] Use assert statement instead of function call Parser should successfully work with it as well --- .../default_value.sts | 2 +- .../07.boxing_conversion/boxing_conversion.sts | 2 +- .../07.boxing_conversion/boxing_coversion_nan.sts | 2 +- .../08.unboxing_conversion/unboxing_conversion.sts | 2 +- .../10.parenthesized_expression/paren_expr.sts | 2 +- .../14.array_access_expression/array_access.sts | 2 +- .../function_invocation_expr.sts | 4 ++-- .../01.postfix_increment_operator/postfix_increment.sts | 4 ++-- .../02.postfix_decrement_operator/postfix_decrement.sts | 4 ++-- .../03.prefix_increment_operator/prefix_increment.sts | 4 ++-- .../04.prefix_decrement_operator/prefix_decrement.sts | 4 ++-- .../05.unary_plus_operator/unary_plus.sts | 2 +- .../06.unary_minus_operator/unary_minus_corner.sts | 2 +- .../06.unary_minus_operator/unary_minus_inbound.sts | 2 +- .../06.unary_minus_operator/unary_minus_onbound.sts | 2 +- .../07.bitwise_complement_operator/bitwise_complement.sts | 2 +- .../08.logical_complement_operator/logical_complement.sts | 2 +- .../01.integer_bitwise_operators/integer_and.sts | 2 +- .../01.integer_bitwise_operators/integer_or.sts | 2 +- .../01.integer_bitwise_operators/integer_xor.sts | 2 +- .../02.logical_bitwise_operators/logical_bitwise_bool.sts | 2 +- .../logical_bitwise_boolean.sts | 2 +- .../26.conditional_and_operator/conditional_and_bool.sts | 4 ++-- .../conditional_and_boolean.sts | 4 ++-- .../27.conditional_or_operator/conditional_or_bool.sts | 4 ++-- .../27.conditional_or_operator/conditional_or_boolean.sts | 4 ++-- .../conditional_expression_evaluation.sts | 8 ++++---- .../conditional_expression_order.sts | 2 +- .../08.statements/04.local_declarations/local_class.sts | 2 +- .../08.statements/04.local_declarations/local_const.sts | 2 +- .../CTS/08.statements/04.local_declarations/local_var.sts | 2 +- .../08.statements/04.local_declarations/n.local_class.sts | 4 ++-- .../08.statements/04.local_declarations/n.local_const.sts | 4 ++-- .../08.statements/04.local_declarations/n.local_var.sts | 4 ++-- .../CTS/08.statements/06.while_and_do_statements/do.sts | 2 +- .../08.statements/06.while_and_do_statements/while.sts | 2 +- .../06.while_and_do_statements/while_not_executed.sts | 2 +- .../CTS/08.statements/09.break_statement/break.sts | 2 +- .../CTS/08.statements/11.return_statement/return.sts | 2 +- .../CTS/08.statements/13.assert_statement/assert.sts | 6 +++--- .../CTS/08.statements/13.assert_statement/n.assert.sts | 6 +++--- .../08.statements/13.assert_statement/n.assert_str.sts | 6 +++--- .../03.enum_constant_methods/enum_constant_ordinals.sts | 2 +- .../03.enum_constant_methods/enum_constant_to_string.sts | 2 +- 44 files changed, 65 insertions(+), 65 deletions(-) diff --git a/migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/06.default_values_for_primitive_types/default_value.sts b/migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/06.default_values_for_primitive_types/default_value.sts index 53a0c7329..475f8bdd7 100644 --- a/migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/06.default_values_for_primitive_types/default_value.sts +++ b/migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/06.default_values_for_primitive_types/default_value.sts @@ -7,7 +7,7 @@ params: {{.i.type}}, {{.i.value}} let x: {{.i.type}}; function main(): void { - assert(x == {{.i.value}}); + assert x == {{.i.value}}; } {% endfor %} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/07.boxing_conversion/boxing_conversion.sts b/migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/07.boxing_conversion/boxing_conversion.sts index c04b87e74..a55012fe9 100644 --- a/migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/07.boxing_conversion/boxing_conversion.sts +++ b/migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/07.boxing_conversion/boxing_conversion.sts @@ -9,7 +9,7 @@ let dest: {{.conv.dest}}; function main(): void { dest = origin; - assert(dest.{{.conv.origin}}Value() == origin); + assert dest.{{.conv.origin}}Value() == origin; } {% endfor %} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/07.boxing_conversion/boxing_coversion_nan.sts b/migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/07.boxing_conversion/boxing_coversion_nan.sts index 5f9b1aa14..cec19df22 100644 --- a/migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/07.boxing_conversion/boxing_coversion_nan.sts +++ b/migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/07.boxing_conversion/boxing_coversion_nan.sts @@ -10,7 +10,7 @@ let dest: {{.conv.dest}}; function main(): void { dest = origin; - assert(dest.isNaN()); + assert dest.isNaN(); } {% endfor %} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/08.unboxing_conversion/unboxing_conversion.sts b/migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/08.unboxing_conversion/unboxing_conversion.sts index d3874afdb..507ac5b22 100644 --- a/migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/08.unboxing_conversion/unboxing_conversion.sts +++ b/migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/08.unboxing_conversion/unboxing_conversion.sts @@ -9,7 +9,7 @@ let dest: {{.conv.dest}}; function main(): void { dest = origin; - assert(dest == origin.{{.conv.dest}}Value()); + assert dest == origin.{{.conv.dest}}Value(); } {% endfor %} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/10.parenthesized_expression/paren_expr.sts b/migrator/test/staticTS/CTS/07.expressions/10.parenthesized_expression/paren_expr.sts index c7f452815..349e5acd6 100644 --- a/migrator/test/staticTS/CTS/07.expressions/10.parenthesized_expression/paren_expr.sts +++ b/migrator/test/staticTS/CTS/07.expressions/10.parenthesized_expression/paren_expr.sts @@ -7,7 +7,7 @@ let x = 1; let y = {{.e}}; function main(): void { - assert(x == y); + assert x == y; } {% endfor %} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/14.array_access_expression/array_access.sts b/migrator/test/staticTS/CTS/07.expressions/14.array_access_expression/array_access.sts index e9ec94fc4..dc941311a 100644 --- a/migrator/test/staticTS/CTS/07.expressions/14.array_access_expression/array_access.sts +++ b/migrator/test/staticTS/CTS/07.expressions/14.array_access_expression/array_access.sts @@ -9,5 +9,5 @@ function main(): void { let y = arr[x]; let z = arr[x+1]; - assert(x == 1 && y == 2 && z == 3); + assert x == 1 && y == 2 && z == 3; } \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/15.function_invocation_expression/function_invocation_expr.sts b/migrator/test/staticTS/CTS/07.expressions/15.function_invocation_expression/function_invocation_expr.sts index c31a2063b..56289f5e2 100644 --- a/migrator/test/staticTS/CTS/07.expressions/15.function_invocation_expression/function_invocation_expr.sts +++ b/migrator/test/staticTS/CTS/07.expressions/15.function_invocation_expression/function_invocation_expr.sts @@ -11,6 +11,6 @@ function callee(a: int, b: bool): int { } function main(): void { - assert(callee(1, true) == 1); - assert(callee(1, false) == -1); + assert callee(1, true) == 1; + assert callee(1, false) == -1; } \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/01.postfix_increment_operator/postfix_increment.sts b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/01.postfix_increment_operator/postfix_increment.sts index 2f73ae219..42c3abdbb 100644 --- a/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/01.postfix_increment_operator/postfix_increment.sts +++ b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/01.postfix_increment_operator/postfix_increment.sts @@ -4,6 +4,6 @@ desc: Postfix increment operator function main(): void { let a = 5; - assert(a++ == 5); - assert(a == 6); + assert a++ == 5; + assert a == 6; } diff --git a/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/02.postfix_decrement_operator/postfix_decrement.sts b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/02.postfix_decrement_operator/postfix_decrement.sts index 531d0c23e..a6ae1105c 100644 --- a/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/02.postfix_decrement_operator/postfix_decrement.sts +++ b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/02.postfix_decrement_operator/postfix_decrement.sts @@ -4,6 +4,6 @@ desc: Postfix decrement operator function main(): void { let a = 5; - assert(a-- == 5); - assert(a == 4); + assert a-- == 5; + assert a == 4; } diff --git a/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/03.prefix_increment_operator/prefix_increment.sts b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/03.prefix_increment_operator/prefix_increment.sts index 4fddeb5df..2d090210b 100644 --- a/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/03.prefix_increment_operator/prefix_increment.sts +++ b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/03.prefix_increment_operator/prefix_increment.sts @@ -4,6 +4,6 @@ desc: Prefix increment operator function main(): void { let a = 5; - assert(++a == 6); - assert(a == 6); + assert ++a == 6; + assert a == 6; } diff --git a/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/04.prefix_decrement_operator/prefix_decrement.sts b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/04.prefix_decrement_operator/prefix_decrement.sts index 6f2bd2d67..48b91947d 100644 --- a/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/04.prefix_decrement_operator/prefix_decrement.sts +++ b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/04.prefix_decrement_operator/prefix_decrement.sts @@ -4,6 +4,6 @@ desc: Prefix decrement operator function main(): void { let a = 5; - assert(--a == 4); - assert(a == 4); + assert --a == 4; + assert a == 4; } diff --git a/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/05.unary_plus_operator/unary_plus.sts b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/05.unary_plus_operator/unary_plus.sts index ac6af76f9..4650c205c 100644 --- a/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/05.unary_plus_operator/unary_plus.sts +++ b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/05.unary_plus_operator/unary_plus.sts @@ -4,5 +4,5 @@ desc: Unary plus operator function main(): void { let a = 5; - assert(+a == a); + assert +a == a; } \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/06.unary_minus_operator/unary_minus_corner.sts b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/06.unary_minus_operator/unary_minus_corner.sts index cccecfa10..9c3decf3b 100644 --- a/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/06.unary_minus_operator/unary_minus_corner.sts +++ b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/06.unary_minus_operator/unary_minus_corner.sts @@ -8,7 +8,7 @@ params: {{.un.origin}} => {{.un.dest}} function main(): void { let a = {{.un.origin}}; - assert(-a == {{.un.dest}}); + assert -a == {{.un.dest}}; } {% endfor %} diff --git a/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/06.unary_minus_operator/unary_minus_inbound.sts b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/06.unary_minus_operator/unary_minus_inbound.sts index 4cb73f2c6..d9a4a48e5 100644 --- a/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/06.unary_minus_operator/unary_minus_inbound.sts +++ b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/06.unary_minus_operator/unary_minus_inbound.sts @@ -7,7 +7,7 @@ params: {{.inb.type}} {{.inb.origin}} => {{.inb.dest}} function main(): void { let a: {{.inb.type}} = {{.inb.origin}}; - assert(-a == {{.inb.dest}}); + assert -a == {{.inb.dest}}; } {% endfor %} diff --git a/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/06.unary_minus_operator/unary_minus_onbound.sts b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/06.unary_minus_operator/unary_minus_onbound.sts index 0c41bcebd..eabe6a003 100644 --- a/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/06.unary_minus_operator/unary_minus_onbound.sts +++ b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/06.unary_minus_operator/unary_minus_onbound.sts @@ -8,7 +8,7 @@ corner-case: true function main(): void { let a: {{.onb.type}} = {{.onb.origin}}; - assert(-a == {{.onb.dest}}); + assert -a == {{.onb.dest}}; } {% endfor %} diff --git a/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/07.bitwise_complement_operator/bitwise_complement.sts b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/07.bitwise_complement_operator/bitwise_complement.sts index 89b0cb87b..a3aa54556 100644 --- a/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/07.bitwise_complement_operator/bitwise_complement.sts +++ b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/07.bitwise_complement_operator/bitwise_complement.sts @@ -7,7 +7,7 @@ params: {{.bw.type}} {{.bw.origin}} => {{.bw.dest}} function main(): void { let a: {{.bw.type}} = {{.bw.origin}}; - assert(~a == {{.bw.dest}}); + assert ~a == {{.bw.dest}}; } {% endfor %} diff --git a/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/08.logical_complement_operator/logical_complement.sts b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/08.logical_complement_operator/logical_complement.sts index 8355f365d..ac8206bfe 100644 --- a/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/08.logical_complement_operator/logical_complement.sts +++ b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/08.logical_complement_operator/logical_complement.sts @@ -6,7 +6,7 @@ params: {{.lc.origin}} => {{.lc.dest}} function main(): void { let a = {{.lc.origin}}; - assert(!a == {{.lc.dest}}); + assert !a == {{.lc.dest}}; } {% endfor %} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/integer_and.sts b/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/integer_and.sts index dc6a4aef1..25fd6911a 100644 --- a/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/integer_and.sts +++ b/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/integer_and.sts @@ -9,7 +9,7 @@ function main(): void { let x: byte = {{.i.xorigin}}; let y: byte = {{.i.yorigin}}; let dest: byte = {{.i.dest}}; - assert((x {{.i.op}} y) == dest); + assert (x {{.i.op}} y) == dest; } {% endfor %} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/integer_or.sts b/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/integer_or.sts index b03d591e9..1578c5aa9 100644 --- a/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/integer_or.sts +++ b/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/integer_or.sts @@ -9,7 +9,7 @@ function main(): void { let x: byte = {{.i.xorigin}}; let y: byte = {{.i.yorigin}}; let dest: byte = {{.i.dest}}; - assert((x {{.i.op}} y) == dest); + assert (x {{.i.op}} y) == dest; } {% endfor %} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/integer_xor.sts b/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/integer_xor.sts index 628ccdad4..893197551 100644 --- a/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/integer_xor.sts +++ b/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/integer_xor.sts @@ -9,7 +9,7 @@ function main(): void { let x: byte = {{.i.xorigin}}; let y: byte = {{.i.yorigin}}; let dest: byte = {{.i.dest}}; - assert((x {{.i.op}} y) == dest); + assert (x {{.i.op}} y) == dest; } {% endfor %} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/02.logical_bitwise_operators/logical_bitwise_bool.sts b/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/02.logical_bitwise_operators/logical_bitwise_bool.sts index 440f8ba3a..9fa3e28c5 100644 --- a/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/02.logical_bitwise_operators/logical_bitwise_bool.sts +++ b/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/02.logical_bitwise_operators/logical_bitwise_bool.sts @@ -9,7 +9,7 @@ function main(): void { let x: boolean = {{.i.xorigin}}; let y: boolean = {{.i.yorigin}}; let dest: boolean = {{.i.dest}}; - assert((x {{.i.op}} y) == dest); + assert (x {{.i.op}} y) == dest; } {% endfor %} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/02.logical_bitwise_operators/logical_bitwise_boolean.sts b/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/02.logical_bitwise_operators/logical_bitwise_boolean.sts index 2daec3fa2..d6d4616b0 100644 --- a/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/02.logical_bitwise_operators/logical_bitwise_boolean.sts +++ b/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/02.logical_bitwise_operators/logical_bitwise_boolean.sts @@ -9,7 +9,7 @@ function main(): void { let x: Boolean = {{.i.xorigin}}; let y: Boolean = {{.i.yorigin}}; let dest: Boolean = {{.i.dest}}; - assert((x {{.i.op}} y) == dest); + assert (x {{.i.op}} y) == dest; } {% endfor %} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/26.conditional_and_operator/conditional_and_bool.sts b/migrator/test/staticTS/CTS/07.expressions/26.conditional_and_operator/conditional_and_bool.sts index c08d019fb..222ca2a23 100644 --- a/migrator/test/staticTS/CTS/07.expressions/26.conditional_and_operator/conditional_and_bool.sts +++ b/migrator/test/staticTS/CTS/07.expressions/26.conditional_and_operator/conditional_and_bool.sts @@ -3,11 +3,11 @@ desc: Conditional and operator ---*/ function check(): boolean { - assert(false); + assert false; return true; } function main(): void { let x: boolean = false; - assert(!(x && check())); + assert !(x && check()); } \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/26.conditional_and_operator/conditional_and_boolean.sts b/migrator/test/staticTS/CTS/07.expressions/26.conditional_and_operator/conditional_and_boolean.sts index 839a18ec0..c1ccddfc1 100644 --- a/migrator/test/staticTS/CTS/07.expressions/26.conditional_and_operator/conditional_and_boolean.sts +++ b/migrator/test/staticTS/CTS/07.expressions/26.conditional_and_operator/conditional_and_boolean.sts @@ -3,11 +3,11 @@ desc: Conditional and operator ---*/ function check(): Boolean { - assert(false); + assert false; return true; } function main(): void { let x: Boolean = false; - assert(!(x && check())); + assert !(x && check()); } \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/27.conditional_or_operator/conditional_or_bool.sts b/migrator/test/staticTS/CTS/07.expressions/27.conditional_or_operator/conditional_or_bool.sts index 812de2f9b..2dfc05764 100644 --- a/migrator/test/staticTS/CTS/07.expressions/27.conditional_or_operator/conditional_or_bool.sts +++ b/migrator/test/staticTS/CTS/07.expressions/27.conditional_or_operator/conditional_or_bool.sts @@ -3,11 +3,11 @@ desc: Conditional or operator ---*/ function check(): boolean { - assert(false); + assert false; return true; } function main(): void { let x: boolean = true; - assert(x || check()); + assert x || check(); } \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/27.conditional_or_operator/conditional_or_boolean.sts b/migrator/test/staticTS/CTS/07.expressions/27.conditional_or_operator/conditional_or_boolean.sts index 4a49fa654..22c27c5fa 100644 --- a/migrator/test/staticTS/CTS/07.expressions/27.conditional_or_operator/conditional_or_boolean.sts +++ b/migrator/test/staticTS/CTS/07.expressions/27.conditional_or_operator/conditional_or_boolean.sts @@ -3,11 +3,11 @@ desc: Conditional or operator ---*/ function check(): Boolean { - assert(false); + assert false; return true; } function main(): void { let x: Boolean = true; - assert(x || check()); + assert x || check(); } \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/29.conditional_expressions/conditional_expression_evaluation.sts b/migrator/test/staticTS/CTS/07.expressions/29.conditional_expressions/conditional_expression_evaluation.sts index 15bc61512..61e428e56 100644 --- a/migrator/test/staticTS/CTS/07.expressions/29.conditional_expressions/conditional_expression_evaluation.sts +++ b/migrator/test/staticTS/CTS/07.expressions/29.conditional_expressions/conditional_expression_evaluation.sts @@ -3,20 +3,20 @@ desc: Conditional expression order ---*/ function f1(): int { - assert(false); + assert false; return 1; } function f2(): int { - assert(false); + assert false; return 2; } function f3(): int { - assert(false); + assert false; return 3; } function main(): void { let cond = false; let a = cond?f1():cond?f2():cond?f3():0; - assert(a == 0); + assert a == 0; } \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/29.conditional_expressions/conditional_expression_order.sts b/migrator/test/staticTS/CTS/07.expressions/29.conditional_expressions/conditional_expression_order.sts index ae22d2c25..8c1864a99 100644 --- a/migrator/test/staticTS/CTS/07.expressions/29.conditional_expressions/conditional_expression_order.sts +++ b/migrator/test/staticTS/CTS/07.expressions/29.conditional_expressions/conditional_expression_order.sts @@ -6,5 +6,5 @@ function main(): void { let cond = false; let a = cond?1:cond?2:cond?3:0; let b = cond?1:(cond?2:(cond?3:0)); - assert(a == b); + assert a == b; } \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/08.statements/04.local_declarations/local_class.sts b/migrator/test/staticTS/CTS/08.statements/04.local_declarations/local_class.sts index 3359b80f5..bd418d8f2 100644 --- a/migrator/test/staticTS/CTS/08.statements/04.local_declarations/local_class.sts +++ b/migrator/test/staticTS/CTS/08.statements/04.local_declarations/local_class.sts @@ -5,5 +5,5 @@ desc: Local declaration in statement (const) function main(): void { class A {} let a: A = new A; - assert(a != null); + assert a != null; } diff --git a/migrator/test/staticTS/CTS/08.statements/04.local_declarations/local_const.sts b/migrator/test/staticTS/CTS/08.statements/04.local_declarations/local_const.sts index 8ce8d2866..43aa3b913 100644 --- a/migrator/test/staticTS/CTS/08.statements/04.local_declarations/local_const.sts +++ b/migrator/test/staticTS/CTS/08.statements/04.local_declarations/local_const.sts @@ -4,5 +4,5 @@ desc: Local declaration in statement (const) function main(): void { const a: int = 0; - assert(a == 0); + assert a == 0; } diff --git a/migrator/test/staticTS/CTS/08.statements/04.local_declarations/local_var.sts b/migrator/test/staticTS/CTS/08.statements/04.local_declarations/local_var.sts index 5e95cd63b..381559b3f 100644 --- a/migrator/test/staticTS/CTS/08.statements/04.local_declarations/local_var.sts +++ b/migrator/test/staticTS/CTS/08.statements/04.local_declarations/local_var.sts @@ -4,5 +4,5 @@ desc: Local declaration in statement (var) function main(): void { let a: int = 0; - assert(a == 0); + assert a == 0; } diff --git a/migrator/test/staticTS/CTS/08.statements/04.local_declarations/n.local_class.sts b/migrator/test/staticTS/CTS/08.statements/04.local_declarations/n.local_class.sts index 3a7421c0e..6ab336afc 100644 --- a/migrator/test/staticTS/CTS/08.statements/04.local_declarations/n.local_class.sts +++ b/migrator/test/staticTS/CTS/08.statements/04.local_declarations/n.local_class.sts @@ -6,7 +6,7 @@ function main(): void { { class A {} let a: A = new A; - assert(a != null); + assert a != null; } - assert(a != null); + assert a != null; } diff --git a/migrator/test/staticTS/CTS/08.statements/04.local_declarations/n.local_const.sts b/migrator/test/staticTS/CTS/08.statements/04.local_declarations/n.local_const.sts index f435cf1da..417d3273f 100644 --- a/migrator/test/staticTS/CTS/08.statements/04.local_declarations/n.local_const.sts +++ b/migrator/test/staticTS/CTS/08.statements/04.local_declarations/n.local_const.sts @@ -5,7 +5,7 @@ desc: Local declaration in statement (const) function main(): void { { const a: int = 0; - assert(a == 0); + assert a == 0; } - assert(a == 0); + assert a == 0; } diff --git a/migrator/test/staticTS/CTS/08.statements/04.local_declarations/n.local_var.sts b/migrator/test/staticTS/CTS/08.statements/04.local_declarations/n.local_var.sts index e69e64e9a..8dbb54a0e 100644 --- a/migrator/test/staticTS/CTS/08.statements/04.local_declarations/n.local_var.sts +++ b/migrator/test/staticTS/CTS/08.statements/04.local_declarations/n.local_var.sts @@ -5,7 +5,7 @@ desc: Local declaration in statement (var) function main(): void { { let a: int = 0; - assert(a == 0); + assert a == 0; } - assert(a == 0); + assert a == 0; } diff --git a/migrator/test/staticTS/CTS/08.statements/06.while_and_do_statements/do.sts b/migrator/test/staticTS/CTS/08.statements/06.while_and_do_statements/do.sts index 43e51ea42..998665991 100644 --- a/migrator/test/staticTS/CTS/08.statements/06.while_and_do_statements/do.sts +++ b/migrator/test/staticTS/CTS/08.statements/06.while_and_do_statements/do.sts @@ -8,5 +8,5 @@ function main(): void { i--; } while (i > 0); - assert(i == 0); + assert i == 0; } \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/08.statements/06.while_and_do_statements/while.sts b/migrator/test/staticTS/CTS/08.statements/06.while_and_do_statements/while.sts index 9c6327255..ca0ef5297 100644 --- a/migrator/test/staticTS/CTS/08.statements/06.while_and_do_statements/while.sts +++ b/migrator/test/staticTS/CTS/08.statements/06.while_and_do_statements/while.sts @@ -7,5 +7,5 @@ function main(): void { while (i > 0) { i--; } - assert(i == 0); + assert i == 0; } \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/08.statements/06.while_and_do_statements/while_not_executed.sts b/migrator/test/staticTS/CTS/08.statements/06.while_and_do_statements/while_not_executed.sts index bffcfe770..533fda4d5 100644 --- a/migrator/test/staticTS/CTS/08.statements/06.while_and_do_statements/while_not_executed.sts +++ b/migrator/test/staticTS/CTS/08.statements/06.while_and_do_statements/while_not_executed.sts @@ -4,6 +4,6 @@ desc: While statement (not executed) function main(): void { while (false) { - assert(false); + assert false; } } \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/08.statements/09.break_statement/break.sts b/migrator/test/staticTS/CTS/08.statements/09.break_statement/break.sts index 9f75bd89c..b8c12692c 100644 --- a/migrator/test/staticTS/CTS/08.statements/09.break_statement/break.sts +++ b/migrator/test/staticTS/CTS/08.statements/09.break_statement/break.sts @@ -10,5 +10,5 @@ function main(): void { i--; } - assert(i == 2); + assert i == 2; } \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/08.statements/11.return_statement/return.sts b/migrator/test/staticTS/CTS/08.statements/11.return_statement/return.sts index 67395b2bf..4139d43a9 100644 --- a/migrator/test/staticTS/CTS/08.statements/11.return_statement/return.sts +++ b/migrator/test/staticTS/CTS/08.statements/11.return_statement/return.sts @@ -5,5 +5,5 @@ desc: Return statement function main(): void { return; - assert(false); + assert false; } \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/08.statements/13.assert_statement/assert.sts b/migrator/test/staticTS/CTS/08.statements/13.assert_statement/assert.sts index c515b20eb..ea25149d9 100644 --- a/migrator/test/staticTS/CTS/08.statements/13.assert_statement/assert.sts +++ b/migrator/test/staticTS/CTS/08.statements/13.assert_statement/assert.sts @@ -1,7 +1,7 @@ -/* +/*--- desc: Assert statement -*/ +---*/ function main(): void { - assert(true); + assert true; } \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/08.statements/13.assert_statement/n.assert.sts b/migrator/test/staticTS/CTS/08.statements/13.assert_statement/n.assert.sts index 0fce1ed38..aa7983989 100644 --- a/migrator/test/staticTS/CTS/08.statements/13.assert_statement/n.assert.sts +++ b/migrator/test/staticTS/CTS/08.statements/13.assert_statement/n.assert.sts @@ -1,7 +1,7 @@ -/* +/*--- desc: Assert statement (failed) -*/ +---*/ function main(): void { - assert(false); + assert false; } \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/08.statements/13.assert_statement/n.assert_str.sts b/migrator/test/staticTS/CTS/08.statements/13.assert_statement/n.assert_str.sts index 6ef4b7c8a..a3d762a68 100644 --- a/migrator/test/staticTS/CTS/08.statements/13.assert_statement/n.assert_str.sts +++ b/migrator/test/staticTS/CTS/08.statements/13.assert_statement/n.assert_str.sts @@ -1,7 +1,7 @@ -/* +/*--- desc: Assert statement (failed) -*/ +---*/ function main(): void { - assert(false, "Assert failed"); + assert false : "Assert failed"; } \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/11.enums/03.enum_constant_methods/enum_constant_ordinals.sts b/migrator/test/staticTS/CTS/11.enums/03.enum_constant_methods/enum_constant_ordinals.sts index 874489519..1861264d8 100644 --- a/migrator/test/staticTS/CTS/11.enums/03.enum_constant_methods/enum_constant_ordinals.sts +++ b/migrator/test/staticTS/CTS/11.enums/03.enum_constant_methods/enum_constant_ordinals.sts @@ -10,6 +10,6 @@ enum GeneratedEnum { function main(): void { {% for i in range(0, 9) %} - assert(GeneratedEnum.{% for _ in range(i + 1)%}A{% endfor %}.ordinal() == {{.i}}); + assert GeneratedEnum.{% for _ in range(i + 1)%}A{% endfor %}.ordinal() == {{.i}}; {%- endfor %} } \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/11.enums/03.enum_constant_methods/enum_constant_to_string.sts b/migrator/test/staticTS/CTS/11.enums/03.enum_constant_methods/enum_constant_to_string.sts index 09a109f09..6ab6ee675 100644 --- a/migrator/test/staticTS/CTS/11.enums/03.enum_constant_methods/enum_constant_to_string.sts +++ b/migrator/test/staticTS/CTS/11.enums/03.enum_constant_methods/enum_constant_to_string.sts @@ -10,6 +10,6 @@ enum GeneratedEnum { function main(): void { {% for i in range(0, 9) %} - assert(GeneratedEnum.{% for _ in range(i + 1)%}A{% endfor %}.toString() == "{% for _ in range(i + 1)%}A{% endfor %}"); + assert GeneratedEnum.{% for _ in range(i + 1)%}A{% endfor %}.toString() == "{% for _ in range(i + 1)%}A{% endfor %}"; {%- endfor %} } \ No newline at end of file -- Gitee From 946d069424c890600ddc2adddd0a382e0cc8524c Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Tue, 16 Aug 2022 13:01:05 +0300 Subject: [PATCH 17/84] Add numerical comparison tests --- .../float_comparison.sts | 13 ++ .../integer_comparison.sts | 13 ++ .../list.float_comparison.yaml | 137 ++++++++++++++++++ .../list.integer_comparison.yaml | 69 +++++++++ 4 files changed, 232 insertions(+) create mode 100644 migrator/test/staticTS/CTS/07.expressions/22.relational_operators/01.numerical_comparison_operators/float_comparison.sts create mode 100644 migrator/test/staticTS/CTS/07.expressions/22.relational_operators/01.numerical_comparison_operators/integer_comparison.sts create mode 100644 migrator/test/staticTS/CTS/07.expressions/22.relational_operators/01.numerical_comparison_operators/list.float_comparison.yaml create mode 100644 migrator/test/staticTS/CTS/07.expressions/22.relational_operators/01.numerical_comparison_operators/list.integer_comparison.yaml diff --git a/migrator/test/staticTS/CTS/07.expressions/22.relational_operators/01.numerical_comparison_operators/float_comparison.sts b/migrator/test/staticTS/CTS/07.expressions/22.relational_operators/01.numerical_comparison_operators/float_comparison.sts new file mode 100644 index 000000000..105299a38 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/22.relational_operators/01.numerical_comparison_operators/float_comparison.sts @@ -0,0 +1,13 @@ +{% for fc in float_comparison %} + +/*--- +desc: Integer comparison {{.fc.xvalue}} {{.fc.op}} {{.fc.yvalue}} +---*/ + +function main(): void { + let x: {{.fc.xtype}} = {{.fc.xvalue}}; + let y: {{.fc.ytype}} = {{.fc.yvalue}}; + assert (x {{.fc.op}} y) == {{.fc.result}}; +} + +{% endfor %} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/22.relational_operators/01.numerical_comparison_operators/integer_comparison.sts b/migrator/test/staticTS/CTS/07.expressions/22.relational_operators/01.numerical_comparison_operators/integer_comparison.sts new file mode 100644 index 000000000..d25f36816 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/22.relational_operators/01.numerical_comparison_operators/integer_comparison.sts @@ -0,0 +1,13 @@ +{% for ic in integer_comparison %} + +/*--- +desc: Integer comparison {{.ic.xvalue}} {{.ic.op}} {{.ic.yvalue}} +---*/ + +function main(): void { + let x: {{.ic.xtype}} = {{.ic.xvalue}}; + let y: {{.ic.ytype}} = {{.ic.yvalue}}; + assert (x {{.ic.op}} y) == {{.ic.result}}; +} + +{% endfor %} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/22.relational_operators/01.numerical_comparison_operators/list.float_comparison.yaml b/migrator/test/staticTS/CTS/07.expressions/22.relational_operators/01.numerical_comparison_operators/list.float_comparison.yaml new file mode 100644 index 000000000..d543d624f --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/22.relational_operators/01.numerical_comparison_operators/list.float_comparison.yaml @@ -0,0 +1,137 @@ +--- # List of integer comparison tests + +# >, no type promotion + +- {xtype: double, xvalue: 0.0, ytype: double, yvalue: 1.0, op: ">", result: "false"} +- {xtype: double, xvalue: 1.0, ytype: double, yvalue: 0.0, op: ">", result: "true"} +- {xtype: double, xvalue: -1.0, ytype: double, yvalue: 0.0, op: ">", result: "false"} +- {xtype: double, xvalue: 0.0, ytype: double, yvalue: -1.0, op: ">", result: "true"} + +# >, with type promotion + +- {xtype: float, xvalue: 0.0, ytype: float, yvalue: 1.0, op: ">", result: "false"} +- {xtype: float, xvalue: 1.0, ytype: float, yvalue: 0.0, op: ">", result: "true"} +- {xtype: float, xvalue: -1.0, ytype: float, yvalue: 0.0, op: ">", result: "false"} +- {xtype: float, xvalue: 0.0, ytype: float, yvalue: -1.0, op: ">", result: "true"} + +# <, no type promotion + +- {xtype: double, xvalue: 0.0, ytype: double, yvalue: 1.0, op: "<", result: "true"} +- {xtype: double, xvalue: 1.0, ytype: double, yvalue: 0.0, op: "<", result: "false"} +- {xtype: double, xvalue: -1.0, ytype: double, yvalue: 0.0, op: "<", result: "true"} +- {xtype: double, xvalue: 0.0, ytype: double, yvalue: -1.0, op: "<", result: "false"} + +# <, with type promotion + +- {xtype: float, xvalue: 0.0, ytype: float, yvalue: 1.0, op: "<", result: "true"} +- {xtype: float, xvalue: 1.0, ytype: float, yvalue: 0.0, op: "<", result: "false"} +- {xtype: float, xvalue: -1.0, ytype: float, yvalue: 0.0, op: "<", result: "true"} +- {xtype: float, xvalue: 0.0, ytype: float, yvalue: -1.0, op: "<", result: "false"} + +# >=, no type promotion + +- {xtype: double, xvalue: 0.0, ytype: double, yvalue: 1.0, op: ">=", result: "false"} +- {xtype: double, xvalue: 1.0, ytype: double, yvalue: 0.0, op: ">=", result: "true"} +- {xtype: double, xvalue: -1.0, ytype: double, yvalue: 0.0, op: ">=", result: "false"} +- {xtype: double, xvalue: 0.0, ytype: double, yvalue: -1.0, op: ">=", result: "true"} + +# >=, with type promotion + +- {xtype: double, xvalue: 0.0, ytype: float, yvalue: 1.0, op: ">=", result: "false"} +- {xtype: double, xvalue: 1.0, ytype: float, yvalue: 0.0, op: ">=", result: "true"} +- {xtype: double, xvalue: -1.0, ytype: float, yvalue: 0.0, op: ">=", result: "false"} +- {xtype: double, xvalue: 0.0, ytype: float, yvalue: -1.0, op: ">=", result: "true"} + +# <=, no type promotion + +- {xtype: double, xvalue: 0.0, ytype: double, yvalue: 1.0, op: "<=", result: "true"} +- {xtype: double, xvalue: 1.0, ytype: double, yvalue: 0.0, op: "<=", result: "false"} +- {xtype: double, xvalue: -1.0, ytype: double, yvalue: 0.0, op: "<=", result: "true"} +- {xtype: double, xvalue: 0.0, ytype: double, yvalue: -1.0, op: "<=", result: "false"} + +# <=, with type promotion + +- {xtype: float, xvalue: 0.0, ytype: float, yvalue: 1.0, op: "<=", result: "true"} +- {xtype: float, xvalue: 1.0, ytype: float, yvalue: 0.0, op: "<=", result: "false"} +- {xtype: float, xvalue: -1.0, ytype: float, yvalue: 0.0, op: "<=", result: "true"} +- {xtype: float, xvalue: 0.0, ytype: float, yvalue: -1.0, op: "<=", result: "false"} + +# >=, <= + +- {xtype: float, xvalue: 0.0, ytype: float, yvalue: -0.0, op: ">=", result: "true"} +- {xtype: float, xvalue: 0.0, ytype: float, yvalue: -0.0, op: "<=", result: "true"} + +- {xtype: float, xvalue: 1.0, ytype: float, yvalue: 1.0, op: ">=", result: "true"} +- {xtype: float, xvalue: 1.0, ytype: float, yvalue: 1.0, op: "<=", result: "true"} + +- {xtype: float, xvalue: -1.0, ytype: float, yvalue: -1.0, op: ">=", result: "true"} +- {xtype: float, xvalue: -1.0, ytype: float, yvalue: -1.0, op: "<=", result: "true"} + + +- {xtype: double, xvalue: 0.0, ytype: double, yvalue: -0.0, op: ">=", result: "true"} +- {xtype: double, xvalue: 0.0, ytype: double, yvalue: -0.0, op: "<=", result: "true"} + +- {xtype: double, xvalue: 1.0, ytype: double, yvalue: 1.0, op: ">=", result: "true"} +- {xtype: double, xvalue: 1.0, ytype: double, yvalue: 1.0, op: "<=", result: "true"} + +- {xtype: double, xvalue: -1.0, ytype: double, yvalue: -1.0, op: ">=", result: "true"} +- {xtype: double, xvalue: -1.0, ytype: double, yvalue: -1.0, op: "<=", result: "true"} + +# NaNs + +- {xtype: float, xvalue: NaN, ytype: float, yvalue: 0.0, op: ">", result: "false"} +- {xtype: float, xvalue: 0.0, ytype: float, yvalue: NaN, op: ">", result: "false"} + +- {xtype: float, xvalue: NaN, ytype: float, yvalue: 0.0, op: "<", result: "false"} +- {xtype: float, xvalue: 0.0, ytype: float, yvalue: NaN, op: "<", result: "false"} + +- {xtype: float, xvalue: NaN, ytype: float, yvalue: 0.0, op: ">=", result: "false"} +- {xtype: float, xvalue: 0.0, ytype: float, yvalue: NaN, op: ">=", result: "false"} + +- {xtype: float, xvalue: NaN, ytype: float, yvalue: 0.0, op: "<=", result: "false"} +- {xtype: float, xvalue: 0.0, ytype: float, yvalue: NaN, op: "<=", result: "false"} + +- {xtype: double, xvalue: NaN, ytype: double, yvalue: 0.0, op: ">", result: "false"} +- {xtype: double, xvalue: 0.0, ytype: double, yvalue: NaN, op: ">", result: "false"} + +- {xtype: double, xvalue: NaN, ytype: double, yvalue: 0.0, op: "<", result: "false"} +- {xtype: double, xvalue: 0.0, ytype: double, yvalue: NaN, op: "<", result: "false"} + +- {xtype: double, xvalue: NaN, ytype: double, yvalue: 0.0, op: ">=", result: "false"} +- {xtype: double, xvalue: 0.0, ytype: double, yvalue: NaN, op: ">=", result: "false"} + +- {xtype: double, xvalue: NaN, ytype: double, yvalue: 0.0, op: "<=", result: "false"} +- {xtype: double, xvalue: 0.0, ytype: double, yvalue: NaN, op: "<=", result: "false"} + +# INFs + +- {xtype: float, xvalue: -INF, ytype: float, yvalue: 0.0, op: "<", result: "true"} +- {xtype: float, xvalue: -INF, ytype: float, yvalue: 0.0, op: "<=", result: "true"} +- {xtype: float, xvalue: -INF, ytype: float, yvalue: 0.0, op: ">", result: "false"} +- {xtype: float, xvalue: -INF, ytype: float, yvalue: 0.0, op: ">=", result: "false"} + +- {xtype: float, xvalue: 0.0, ytype: float, yvalue: INF, op: "<", result: "true"} +- {xtype: float, xvalue: 0.0, ytype: float, yvalue: INF, op: "<=", result: "true"} +- {xtype: float, xvalue: 0.0, ytype: float, yvalue: INF, op: ">", result: "false"} +- {xtype: float, xvalue: 0.0, ytype: float, yvalue: INF, op: ">=", result: "false"} + +- {xtype: float, xvalue: -INF, ytype: float, yvalue: INF, op: "<", result: "true"} +- {xtype: float, xvalue: -INF, ytype: float, yvalue: INF, op: "<=", result: "true"} +- {xtype: float, xvalue: -INF, ytype: float, yvalue: INF, op: ">", result: "false"} +- {xtype: float, xvalue: -INF, ytype: float, yvalue: INF, op: ">=", result: "false"} + + +- {xtype: double, xvalue: -INF, ytype: double, yvalue: 0.0, op: "<", result: "true"} +- {xtype: double, xvalue: -INF, ytype: double, yvalue: 0.0, op: "<=", result: "true"} +- {xtype: double, xvalue: -INF, ytype: double, yvalue: 0.0, op: ">", result: "false"} +- {xtype: double, xvalue: -INF, ytype: double, yvalue: 0.0, op: ">=", result: "false"} + +- {xtype: double, xvalue: 0.0, ytype: double, yvalue: INF, op: "<", result: "true"} +- {xtype: double, xvalue: 0.0, ytype: double, yvalue: INF, op: "<=", result: "true"} +- {xtype: double, xvalue: 0.0, ytype: double, yvalue: INF, op: ">", result: "false"} +- {xtype: double, xvalue: 0.0, ytype: double, yvalue: INF, op: ">=", result: "false"} + +- {xtype: double, xvalue: -INF, ytype: double, yvalue: INF, op: "<", result: "true"} +- {xtype: double, xvalue: -INF, ytype: double, yvalue: INF, op: "<=", result: "true"} +- {xtype: double, xvalue: -INF, ytype: double, yvalue: INF, op: ">", result: "false"} +- {xtype: double, xvalue: -INF, ytype: double, yvalue: INF, op: ">=", result: "false"} diff --git a/migrator/test/staticTS/CTS/07.expressions/22.relational_operators/01.numerical_comparison_operators/list.integer_comparison.yaml b/migrator/test/staticTS/CTS/07.expressions/22.relational_operators/01.numerical_comparison_operators/list.integer_comparison.yaml new file mode 100644 index 000000000..da04ae629 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/22.relational_operators/01.numerical_comparison_operators/list.integer_comparison.yaml @@ -0,0 +1,69 @@ +--- # List of integer comparison tests + +# >, no type promotion + +- {xtype: int, xvalue: 0, ytype: int, yvalue: 1, op: ">", result: "false"} +- {xtype: int, xvalue: 1, ytype: int, yvalue: 0, op: ">", result: "true"} +- {xtype: int, xvalue: -1, ytype: int, yvalue: 0, op: ">", result: "false"} +- {xtype: int, xvalue: 0, ytype: int, yvalue: -1, op: ">", result: "true"} + +# >, with type promotion + +- {xtype: byte, xvalue: 0, ytype: byte, yvalue: 1, op: ">", result: "false"} +- {xtype: byte, xvalue: 1, ytype: byte, yvalue: 0, op: ">", result: "true"} +- {xtype: byte, xvalue: -1, ytype: byte, yvalue: 0, op: ">", result: "false"} +- {xtype: byte, xvalue: 0, ytype: byte, yvalue: -1, op: ">", result: "true"} + +# <, no type promotion + +- {xtype: int, xvalue: 0, ytype: int, yvalue: 1, op: "<", result: "true"} +- {xtype: int, xvalue: 1, ytype: int, yvalue: 0, op: "<", result: "false"} +- {xtype: int, xvalue: -1, ytype: int, yvalue: 0, op: "<", result: "true"} +- {xtype: int, xvalue: 0, ytype: int, yvalue: -1, op: "<", result: "false"} + +# <, with type promotion + +- {xtype: byte, xvalue: 0, ytype: byte, yvalue: 1, op: "<", result: "true"} +- {xtype: byte, xvalue: 1, ytype: byte, yvalue: 0, op: "<", result: "false"} +- {xtype: byte, xvalue: -1, ytype: byte, yvalue: 0, op: "<", result: "true"} +- {xtype: byte, xvalue: 0, ytype: byte, yvalue: -1, op: "<", result: "false"} + +# >=, no type promotion + +- {xtype: int, xvalue: 0, ytype: int, yvalue: 1, op: ">=", result: "false"} +- {xtype: int, xvalue: 1, ytype: int, yvalue: 0, op: ">=", result: "true"} +- {xtype: int, xvalue: -1, ytype: int, yvalue: 0, op: ">=", result: "false"} +- {xtype: int, xvalue: 0, ytype: int, yvalue: -1, op: ">=", result: "true"} + +# >=, with type promotion + +- {xtype: int, xvalue: 0, ytype: byte, yvalue: 1, op: ">=", result: "false"} +- {xtype: int, xvalue: 1, ytype: byte, yvalue: 0, op: ">=", result: "true"} +- {xtype: int, xvalue: -1, ytype: byte, yvalue: 0, op: ">=", result: "false"} +- {xtype: int, xvalue: 0, ytype: byte, yvalue: -1, op: ">=", result: "true"} + +# <=, no type promotion + +- {xtype: int, xvalue: 0, ytype: int, yvalue: 1, op: "<=", result: "true"} +- {xtype: int, xvalue: 1, ytype: int, yvalue: 0, op: "<=", result: "false"} +- {xtype: int, xvalue: -1, ytype: int, yvalue: 0, op: "<=", result: "true"} +- {xtype: int, xvalue: 0, ytype: int, yvalue: -1, op: "<=", result: "false"} + +# <=, with type promotion + +- {xtype: byte, xvalue: 0, ytype: byte, yvalue: 1, op: "<=", result: "true"} +- {xtype: byte, xvalue: 1, ytype: byte, yvalue: 0, op: "<=", result: "false"} +- {xtype: byte, xvalue: -1, ytype: byte, yvalue: 0, op: "<=", result: "true"} +- {xtype: byte, xvalue: 0, ytype: byte, yvalue: -1, op: "<=", result: "false"} + +# >=, <= + +- {xtype: int, xvalue: 0, ytype: int, yvalue: -0, op: ">=", result: "true"} +- {xtype: int, xvalue: 0, ytype: int, yvalue: -0, op: "<=", result: "true"} + +- {xtype: int, xvalue: 1, ytype: int, yvalue: 1, op: ">=", result: "true"} +- {xtype: int, xvalue: 1, ytype: int, yvalue: 1, op: "<=", result: "true"} + +- {xtype: int, xvalue: -1, ytype: int, yvalue: -1, op: ">=", result: "true"} +- {xtype: int, xvalue: -1, ytype: int, yvalue: -1, op: "<=", result: "true"} + -- Gitee From ec82c737a8c154388de1969d754eb9bde57dc3c8 Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Tue, 16 Aug 2022 13:56:49 +0300 Subject: [PATCH 18/84] Add type comparison operator tests --- .../instanceof.sts | 19 +++++++++++++++++++ .../list.instanceof.yaml | 8 ++++++++ 2 files changed, 27 insertions(+) create mode 100644 migrator/test/staticTS/CTS/07.expressions/23.type_comparison_operator/instanceof.sts create mode 100644 migrator/test/staticTS/CTS/07.expressions/23.type_comparison_operator/list.instanceof.yaml diff --git a/migrator/test/staticTS/CTS/07.expressions/23.type_comparison_operator/instanceof.sts b/migrator/test/staticTS/CTS/07.expressions/23.type_comparison_operator/instanceof.sts new file mode 100644 index 000000000..b7c54dff1 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/23.type_comparison_operator/instanceof.sts @@ -0,0 +1,19 @@ +{% for io in instanceof %} +/*--- +desc: instanceof operator test +params: | + {{.io.negation}}({{.io.left}} instanceof {{.io.right}}) +---*/ + +class A {} +class B {} + +function main(): void { + let a = new A; + let b = new B; + let n = null; + + assert {{.io.negation}}({{.io.left}} instanceof {{.io.right}}); +} + +{% endfor %} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/23.type_comparison_operator/list.instanceof.yaml b/migrator/test/staticTS/CTS/07.expressions/23.type_comparison_operator/list.instanceof.yaml new file mode 100644 index 000000000..fe6279a27 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/23.type_comparison_operator/list.instanceof.yaml @@ -0,0 +1,8 @@ +--- # List of instanceof tests + +- {left: a, right: A, negation: ""} +- {left: a, right: B, negation: "!"} +- {left: b, right: A, negation: "!"} +- {left: b, right: B, negation: ""} +- {left: n, right: A, negation: "!"} +- {left: n, right: B, negation: "!"} -- Gitee From 562cacf031b921b4ba945e98de2e79b1897edb9a Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Tue, 16 Aug 2022 14:32:37 +0300 Subject: [PATCH 19/84] Add continue for 'while' --- .../10.continue_statement/continue_while.sts | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 migrator/test/staticTS/CTS/08.statements/10.continue_statement/continue_while.sts diff --git a/migrator/test/staticTS/CTS/08.statements/10.continue_statement/continue_while.sts b/migrator/test/staticTS/CTS/08.statements/10.continue_statement/continue_while.sts new file mode 100644 index 000000000..b4f744deb --- /dev/null +++ b/migrator/test/staticTS/CTS/08.statements/10.continue_statement/continue_while.sts @@ -0,0 +1,13 @@ +/*--- +desc: Continue statement (inside while statement) +---*/ + +function main(): void { + let i: int = 0; + while (i <= 2) { + i++; + continue; + assert false; + } + assert i == 3; +} \ No newline at end of file -- Gitee From a76e0baf2dbd08bfd214503e37a556c8e0be7471 Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Wed, 17 Aug 2022 12:07:13 +0300 Subject: [PATCH 20/84] Fix SimpleLanguage benchmarks --- .../SimpleLanguage/invalid/AccessFannkuch.sts | 7 +-- .../SimpleLanguage/invalid/AccessNBody.sts | 63 +++++++++---------- .../SimpleLanguage/invalid/AccessNSieve.sts | 1 - .../invalid/BitopsNSieveBits.sts | 1 - .../SimpleLanguage/invalid/MathCordic.sts | 5 +- .../invalid/MathSpectralNorm.sts | 3 - .../SimpleLanguage/invalid/Morph3d.sts | 1 - .../SimpleLanguage/invalid/StringBase64.sts | 7 +-- .../SimpleLanguage/invalid/StringFasta.sts | 1 - 9 files changed, 38 insertions(+), 51 deletions(-) diff --git a/migrator/test/staticTS/SimpleLanguage/invalid/AccessFannkuch.sts b/migrator/test/staticTS/SimpleLanguage/invalid/AccessFannkuch.sts index b63d71b8b..e737cae6d 100644 --- a/migrator/test/staticTS/SimpleLanguage/invalid/AccessFannkuch.sts +++ b/migrator/test/staticTS/SimpleLanguage/invalid/AccessFannkuch.sts @@ -25,13 +25,9 @@ export class AccessFannkuch { public setup(): void {} public fannkuch(n: int): int { - // Not parsed new int[n] let perm: int[] = new int[n]; - // Not parsed new int[n] let perm1: int[] = new int[n]; - // Not parsed new int[n] let count: int[] = new int[n]; - // Not parsed new int[n] let maxPerm: int[] = new int[n]; let maxFlipsCount: int = 0; let m: int = n - 1; @@ -42,7 +38,8 @@ export class AccessFannkuch { while (r != 1) { count[r - 1] = r; r--; - } if (!(perm1[0] == 0 || perm1[m] == m)) { + } + if (!(perm1[0] == 0 || perm1[m] == m)) { for (let i: int = 0; i < n; i++) perm[i] = perm1[i]; let flipsCount: int = 0; diff --git a/migrator/test/staticTS/SimpleLanguage/invalid/AccessNBody.sts b/migrator/test/staticTS/SimpleLanguage/invalid/AccessNBody.sts index 0e4b84079..f35b7a3ec 100644 --- a/migrator/test/staticTS/SimpleLanguage/invalid/AccessNBody.sts +++ b/migrator/test/staticTS/SimpleLanguage/invalid/AccessNBody.sts @@ -122,7 +122,7 @@ export class AccessNBody { for (let i: int = 0; i < size; i++) { let bodyi: Body = this.bodies[i]; - e += 0.5 * bodyi.mass * (bodyi.vx * bodyi.vx + bodyi.vy * bodyi.vy + bodyi.vz * bodyi.vz); + e += 0.5 * bodyi.mass * (bodyi.vx * bodyi.vx + bodyi.vy * bodyi.vy + bodyi.vz * bodyi.vz); for (let j: int = i + 1; j < size; j++) { let bodyj: Body = this.bodies[j]; @@ -141,49 +141,49 @@ export class AccessNBody { private static jupiter(): Body { return new Body( - 4.84143144246472090e+00, - -1.16032004402742839e+00, - -1.03622044471123109e-01, - 1.66007664274403694e-03 * DAYS_PER_YEAR, - 7.69901118419740425e-03 * DAYS_PER_YEAR, - -6.90460016972063023e-05 * DAYS_PER_YEAR, - 9.54791938424326609e-04 * SOLAR_MASS + 4.84143144246472090e+0, + -1.16032004402742839e+0, + -1.03622044471123109e-1, + 1.66007664274403694e-3 * DAYS_PER_YEAR, + 7.69901118419740425e-3 * DAYS_PER_YEAR, + -6.90460016972063023e-5 * DAYS_PER_YEAR, + 9.54791938424326609e-4 * SOLAR_MASS ); } private static saturn(): Body { return new Body( - 8.34336671824457987e+00, - 4.12479856412430479e+00, - -4.03523417114321381e-01, - -2.76742510726862411e-03 * DAYS_PER_YEAR, - 4.99852801234917238e-03 * DAYS_PER_YEAR, - 2.30417297573763929e-05 * DAYS_PER_YEAR, - 2.85885980666130812e-04 * SOLAR_MASS + 8.34336671824457987e+0, + 4.12479856412430479e+0, + -4.03523417114321381e-1, + -2.76742510726862411e-3 * DAYS_PER_YEAR, + 4.99852801234917238e-3 * DAYS_PER_YEAR, + 2.30417297573763929e-5 * DAYS_PER_YEAR, + 2.85885980666130812e-4 * SOLAR_MASS ); } private static uranus(): Body { return new Body( - 1.28943695621391310e+01, - -1.51111514016986312e+01, - -2.23307578892655734e-01, - 2.96460137564761618e-03 * DAYS_PER_YEAR, - 2.37847173959480950e-03 * DAYS_PER_YEAR, - -2.96589568540237556e-05 * DAYS_PER_YEAR, - 4.36624404335156298e-05 * SOLAR_MASS + 1.28943695621391310e+1, + -1.51111514016986312e+1, + -2.23307578892655734e-1, + 2.96460137564761618e-3 * DAYS_PER_YEAR, + 2.37847173959480950e-3 * DAYS_PER_YEAR, + -2.96589568540237556e-5 * DAYS_PER_YEAR, + 4.36624404335156298e-5 * SOLAR_MASS ); } private static neptune(): Body { return new Body( - 1.53796971148509165e+01, - -2.59193146099879641e+01, - 1.79258772950371181e-01, - 2.68067772490389322e-03 * DAYS_PER_YEAR, - 1.62824170038242295e-03 * DAYS_PER_YEAR, - -9.51592254519715870e-05 * DAYS_PER_YEAR, - 5.15138902046611451e-05 * SOLAR_MASS + 1.53796971148509165e+1, + -2.59193146099879641e+1, + 1.79258772950371181e-1, + 2.68067772490389322e-3 * DAYS_PER_YEAR, + 1.62824170038242295e-3 * DAYS_PER_YEAR, + -9.51592254519715870e-5 * DAYS_PER_YEAR, + 5.15138902046611451e-5 * SOLAR_MASS ); } @@ -191,13 +191,11 @@ export class AccessNBody { return new Body(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, SOLAR_MASS); } - public run(): void { let ret: double = 0.0; for (let n: int = this.n1; n <= this.n2; n *= 2) { let bodies: NBodySystem = new NBodySystem( - // Not parsed new Body[...] - new Body[]([sun(), jupiter(), saturn(), uranus(), neptune()]) + // [sun(), jupiter(), saturn(), uranus(), neptune()] ); let max: int = n * 100; ret += bodies.energy(); @@ -212,5 +210,6 @@ export class AccessNBody { } Consumer.consumeDouble(ret); } + } diff --git a/migrator/test/staticTS/SimpleLanguage/invalid/AccessNSieve.sts b/migrator/test/staticTS/SimpleLanguage/invalid/AccessNSieve.sts index 80a744a7f..e1eca649b 100644 --- a/migrator/test/staticTS/SimpleLanguage/invalid/AccessNSieve.sts +++ b/migrator/test/staticTS/SimpleLanguage/invalid/AccessNSieve.sts @@ -22,7 +22,6 @@ export class AccessNSieve { static isPrime: boolean[]; public setup(): void { - // Not parsed new boolean[...] this.isPrime = new boolean[(1 << n1) * n2 + 1]; } diff --git a/migrator/test/staticTS/SimpleLanguage/invalid/BitopsNSieveBits.sts b/migrator/test/staticTS/SimpleLanguage/invalid/BitopsNSieveBits.sts index 03b7b7f42..048b1ba2d 100644 --- a/migrator/test/staticTS/SimpleLanguage/invalid/BitopsNSieveBits.sts +++ b/migrator/test/staticTS/SimpleLanguage/invalid/BitopsNSieveBits.sts @@ -34,7 +34,6 @@ export class BitopsNSieveBits { } private static sieve(n1: int, n2: int): int[] { - // Not parsed new int[...] let isPrime: int[] = new int[(n2 << n1) + 31 >> 5]; primes(isPrime, n1, n2); return isPrime; diff --git a/migrator/test/staticTS/SimpleLanguage/invalid/MathCordic.sts b/migrator/test/staticTS/SimpleLanguage/invalid/MathCordic.sts index 73d72b473..6e2afecfd 100644 --- a/migrator/test/staticTS/SimpleLanguage/invalid/MathCordic.sts +++ b/migrator/test/staticTS/SimpleLanguage/invalid/MathCordic.sts @@ -20,12 +20,11 @@ export class MathCordic { static const TARGET_ANGLE: double = 28.027; static const expected: double = 10362.570468755888; - // Not parsed new double[] - static const ANGLES: double[] = new double[] { + static const ANGLES: double[] = [ fnFixed(45.0), fnFixed(26.565), fnFixed(14.0362), fnFixed(7.12502), fnFixed(3.57633), fnFixed(1.78991), fnFixed(0.895174), fnFixed(0.447614), fnFixed(0.223811), fnFixed(0.111906), fnFixed(0.055953), fnFixed(0.027977) - }; + ]; private static fnFixed(x: double): double { return x * 65536.0; diff --git a/migrator/test/staticTS/SimpleLanguage/invalid/MathSpectralNorm.sts b/migrator/test/staticTS/SimpleLanguage/invalid/MathSpectralNorm.sts index e789fa4ee..ec7135355 100644 --- a/migrator/test/staticTS/SimpleLanguage/invalid/MathSpectralNorm.sts +++ b/migrator/test/staticTS/SimpleLanguage/invalid/MathSpectralNorm.sts @@ -47,11 +47,8 @@ export class MathSpectralNorm { private static spectralnorm(n: int): void { let i: int; - // Not parsed new double[n] let u: double[] = new double[n]; - // Not parsed new double[n] let w: double[] = new double[n]; - // Not parsed new double[n] let v: double[] = new double[n]; let vbv: double = 0; let vv: double = 0; diff --git a/migrator/test/staticTS/SimpleLanguage/invalid/Morph3d.sts b/migrator/test/staticTS/SimpleLanguage/invalid/Morph3d.sts index 033eefcf6..160a375d9 100644 --- a/migrator/test/staticTS/SimpleLanguage/invalid/Morph3d.sts +++ b/migrator/test/staticTS/SimpleLanguage/invalid/Morph3d.sts @@ -20,7 +20,6 @@ export class Morph3d { static a: double[]; public setup(): void { - // Not parsed new double[...] a = new double[param * param * 3]; for (let i: int = 0; i < param * param * 3; i++) { a[i] = 0; diff --git a/migrator/test/staticTS/SimpleLanguage/invalid/StringBase64.sts b/migrator/test/staticTS/SimpleLanguage/invalid/StringBase64.sts index 4ff8dd154..ec0f594d9 100644 --- a/migrator/test/staticTS/SimpleLanguage/invalid/StringBase64.sts +++ b/migrator/test/staticTS/SimpleLanguage/invalid/StringBase64.sts @@ -17,10 +17,9 @@ import utils.Consumer; export class StringBase64 { private static const TO_BASE64_TABLE: String = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" - + "abcdefghijklmnopqrstuvwxyz0123456789+/"; + + "abcdefghijklmnopqrstuvwxyz0123456789+/"; private static const BASE64PAD: char = '='; - // Not parsed new int[] - private static const TO_BINARY_TABLE: int[] = new int[]{ + private static const TO_BINARY_TABLE: int[] = [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, @@ -29,7 +28,7 @@ export class StringBase64 { 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1 - }; + ]; private static toBase64(data: String): String { let result: StringBuilder = new StringBuilder(); diff --git a/migrator/test/staticTS/SimpleLanguage/invalid/StringFasta.sts b/migrator/test/staticTS/SimpleLanguage/invalid/StringFasta.sts index b0d977315..9a76094f7 100644 --- a/migrator/test/staticTS/SimpleLanguage/invalid/StringFasta.sts +++ b/migrator/test/staticTS/SimpleLanguage/invalid/StringFasta.sts @@ -104,7 +104,6 @@ export class StringFasta { let ret: int = 0; while (n > 0) { if (n < line.length) { - // Not parsed new char[n] line = new char[n]; } for (let i: int = 0; i < line.length; i++) { -- Gitee From c6dbec8a616aa2f9313712e2c14526806651396c Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Wed, 17 Aug 2022 12:07:54 +0300 Subject: [PATCH 21/84] Move benchmarks out of invalid folder --- .../test/staticTS/SimpleLanguage/{invalid => }/AccessFannkuch.sts | 0 .../test/staticTS/SimpleLanguage/{invalid => }/AccessNBody.sts | 0 .../test/staticTS/SimpleLanguage/{invalid => }/AccessNSieve.sts | 0 .../staticTS/SimpleLanguage/{invalid => }/BitopsNSieveBits.sts | 0 .../test/staticTS/SimpleLanguage/{invalid => }/MathCordic.sts | 0 .../staticTS/SimpleLanguage/{invalid => }/MathSpectralNorm.sts | 0 migrator/test/staticTS/SimpleLanguage/{invalid => }/Morph3d.sts | 0 .../test/staticTS/SimpleLanguage/{invalid => }/StringBase64.sts | 0 .../test/staticTS/SimpleLanguage/{invalid => }/StringFasta.sts | 0 9 files changed, 0 insertions(+), 0 deletions(-) rename migrator/test/staticTS/SimpleLanguage/{invalid => }/AccessFannkuch.sts (100%) rename migrator/test/staticTS/SimpleLanguage/{invalid => }/AccessNBody.sts (100%) rename migrator/test/staticTS/SimpleLanguage/{invalid => }/AccessNSieve.sts (100%) rename migrator/test/staticTS/SimpleLanguage/{invalid => }/BitopsNSieveBits.sts (100%) rename migrator/test/staticTS/SimpleLanguage/{invalid => }/MathCordic.sts (100%) rename migrator/test/staticTS/SimpleLanguage/{invalid => }/MathSpectralNorm.sts (100%) rename migrator/test/staticTS/SimpleLanguage/{invalid => }/Morph3d.sts (100%) rename migrator/test/staticTS/SimpleLanguage/{invalid => }/StringBase64.sts (100%) rename migrator/test/staticTS/SimpleLanguage/{invalid => }/StringFasta.sts (100%) diff --git a/migrator/test/staticTS/SimpleLanguage/invalid/AccessFannkuch.sts b/migrator/test/staticTS/SimpleLanguage/AccessFannkuch.sts similarity index 100% rename from migrator/test/staticTS/SimpleLanguage/invalid/AccessFannkuch.sts rename to migrator/test/staticTS/SimpleLanguage/AccessFannkuch.sts diff --git a/migrator/test/staticTS/SimpleLanguage/invalid/AccessNBody.sts b/migrator/test/staticTS/SimpleLanguage/AccessNBody.sts similarity index 100% rename from migrator/test/staticTS/SimpleLanguage/invalid/AccessNBody.sts rename to migrator/test/staticTS/SimpleLanguage/AccessNBody.sts diff --git a/migrator/test/staticTS/SimpleLanguage/invalid/AccessNSieve.sts b/migrator/test/staticTS/SimpleLanguage/AccessNSieve.sts similarity index 100% rename from migrator/test/staticTS/SimpleLanguage/invalid/AccessNSieve.sts rename to migrator/test/staticTS/SimpleLanguage/AccessNSieve.sts diff --git a/migrator/test/staticTS/SimpleLanguage/invalid/BitopsNSieveBits.sts b/migrator/test/staticTS/SimpleLanguage/BitopsNSieveBits.sts similarity index 100% rename from migrator/test/staticTS/SimpleLanguage/invalid/BitopsNSieveBits.sts rename to migrator/test/staticTS/SimpleLanguage/BitopsNSieveBits.sts diff --git a/migrator/test/staticTS/SimpleLanguage/invalid/MathCordic.sts b/migrator/test/staticTS/SimpleLanguage/MathCordic.sts similarity index 100% rename from migrator/test/staticTS/SimpleLanguage/invalid/MathCordic.sts rename to migrator/test/staticTS/SimpleLanguage/MathCordic.sts diff --git a/migrator/test/staticTS/SimpleLanguage/invalid/MathSpectralNorm.sts b/migrator/test/staticTS/SimpleLanguage/MathSpectralNorm.sts similarity index 100% rename from migrator/test/staticTS/SimpleLanguage/invalid/MathSpectralNorm.sts rename to migrator/test/staticTS/SimpleLanguage/MathSpectralNorm.sts diff --git a/migrator/test/staticTS/SimpleLanguage/invalid/Morph3d.sts b/migrator/test/staticTS/SimpleLanguage/Morph3d.sts similarity index 100% rename from migrator/test/staticTS/SimpleLanguage/invalid/Morph3d.sts rename to migrator/test/staticTS/SimpleLanguage/Morph3d.sts diff --git a/migrator/test/staticTS/SimpleLanguage/invalid/StringBase64.sts b/migrator/test/staticTS/SimpleLanguage/StringBase64.sts similarity index 100% rename from migrator/test/staticTS/SimpleLanguage/invalid/StringBase64.sts rename to migrator/test/staticTS/SimpleLanguage/StringBase64.sts diff --git a/migrator/test/staticTS/SimpleLanguage/invalid/StringFasta.sts b/migrator/test/staticTS/SimpleLanguage/StringFasta.sts similarity index 100% rename from migrator/test/staticTS/SimpleLanguage/invalid/StringFasta.sts rename to migrator/test/staticTS/SimpleLanguage/StringFasta.sts -- Gitee From 628904a1fe57f6094047a0ef33c02672e575cd33 Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Wed, 17 Aug 2022 12:22:15 +0300 Subject: [PATCH 22/84] Add multiplication cases with nan and inf --- .../01.multiplication_operator/list.nan_inf.yaml | 15 +++++++++++++++ .../01.multiplication_operator/nan_inf.sts | 11 +++++++++++ 2 files changed, 26 insertions(+) create mode 100644 migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/01.multiplication_operator/list.nan_inf.yaml create mode 100644 migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/01.multiplication_operator/nan_inf.sts diff --git a/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/01.multiplication_operator/list.nan_inf.yaml b/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/01.multiplication_operator/list.nan_inf.yaml new file mode 100644 index 000000000..1cc7f148e --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/01.multiplication_operator/list.nan_inf.yaml @@ -0,0 +1,15 @@ +--- # List of multiplications where NaN involved + +- {x: NaN, y: NaN, result: NaN} +- {x: NaN, y: 0.0, result: NaN} +- {x: 0.0, y: NaN, result: NaN} +- {x: NaN, y: 1.0, result: NaN} +- {x: 1.0, y: NaN, result: NaN} +- {x: NaN, y: INF, result: NaN} +- {x: INF, y: NaN, result: NaN} +- {x: NaN, y: -INF, result: NaN} +- {x: -INF, y: NaN, result: NaN} +- {x: INF, y: 0.0, result: NaN} +- {x: -INF, y: -0.0, result: NaN} +- {x: INF, y: -1.0, result: -INF} +- {x: -INF, y: -1.0, result: INF} diff --git a/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/01.multiplication_operator/nan_inf.sts b/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/01.multiplication_operator/nan_inf.sts new file mode 100644 index 000000000..81e3eba66 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/01.multiplication_operator/nan_inf.sts @@ -0,0 +1,11 @@ +{% for ni in nan_inf %} +/*--- +desc: Multiplications with NaN and INF +params: {{.ni.x}} * {{.ni.y}} == {{.ni.result}} +corner-case: true +---*/ + +function main(): void { + assert {{.ni.x}} * {{.ni.y}} == {{.ni.result}}; +} +{% endfor %} \ No newline at end of file -- Gitee From 0a311fc608b21638c029c2d4c36f32d7e86e023e Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Wed, 17 Aug 2022 15:45:20 +0300 Subject: [PATCH 23/84] Add division samples --- .../02.division_operator/list.integer_div.yaml | 13 +++++++++++++ .../02.division_operator/list.nan_inf.yaml | 17 +++++++++++++++++ .../02.division_operator/nan_inf.sts | 11 +++++++++++ .../tbd.float_div_overflow.sts | 3 +++ .../02.division_operator/tbd.float_division.sts | 3 +++ .../tbd.int_div_overflow.sts | 3 +++ 6 files changed, 50 insertions(+) create mode 100644 migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/02.division_operator/list.integer_div.yaml create mode 100644 migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/02.division_operator/list.nan_inf.yaml create mode 100644 migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/02.division_operator/nan_inf.sts create mode 100644 migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/02.division_operator/tbd.float_div_overflow.sts create mode 100644 migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/02.division_operator/tbd.float_division.sts create mode 100644 migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/02.division_operator/tbd.int_div_overflow.sts diff --git a/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/02.division_operator/list.integer_div.yaml b/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/02.division_operator/list.integer_div.yaml new file mode 100644 index 000000000..a25b96408 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/02.division_operator/list.integer_div.yaml @@ -0,0 +1,13 @@ +--- # List of integer division + +- {x: 0, y: 1, result: 0} +- {x: 0, y: 1, result: 0} +- {x: 1, y: 1, result: 1} +- {x: 0, y: -1, result: 0} +- {x: -1, y: -1, result: 1} + +- {x: 2, y: 2, result: 1} +- {x: 2, y: 1, result: 2} +- {x: 1, y: 2, result: 0} +- {x: 2, y: -1, result: -2} +- {x: -2, y: 1, result: -2} diff --git a/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/02.division_operator/list.nan_inf.yaml b/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/02.division_operator/list.nan_inf.yaml new file mode 100644 index 000000000..b554d44f6 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/02.division_operator/list.nan_inf.yaml @@ -0,0 +1,17 @@ +--- # List of multiplications where NaN involved + +- {x: NaN, y: NaN, result: NaN} +- {x: NaN, y: 1.0, result: NaN} +- {x: 1.0, y: NaN, result: NaN} +- {x: NaN, y: 1.0, result: NaN} +- {x: NaN, y: INF, result: NaN} +- {x: INF, y: NaN, result: NaN} +- {x: NaN, y: -INF, result: NaN} +- {x: -INF, y: NaN, result: NaN} +- {x: 1.0, y: INF, result: 0.0} +- {x: -1.0, y: INF, result: -0.0} +- {x: 1.0, y: -INF, result: -0.0} +- {x: INF, y: INF, result: NaN} +- {x: 0.0, y: 0.0, result: NaN} +- {x: 1.0, y: 0.0, result: INF} +- {x: -1.0, y: 0.0, result: -INF} diff --git a/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/02.division_operator/nan_inf.sts b/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/02.division_operator/nan_inf.sts new file mode 100644 index 000000000..cc3fc6fba --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/02.division_operator/nan_inf.sts @@ -0,0 +1,11 @@ +{% for ni in nan_inf %} +/*--- +desc: Division with NaN and INF +params: {{.ni.x}} / {{.ni.y}} == {{.ni.result}} +corner-case: true +---*/ + +function main(): void { + assert {{.ni.x}} / {{.ni.y}} == {{.ni.result}}; +} +{% endfor %} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/02.division_operator/tbd.float_div_overflow.sts b/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/02.division_operator/tbd.float_div_overflow.sts new file mode 100644 index 000000000..0ff200248 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/02.division_operator/tbd.float_div_overflow.sts @@ -0,0 +1,3 @@ +/*--- +desc: Float numbers division with overflow +---*/ \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/02.division_operator/tbd.float_division.sts b/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/02.division_operator/tbd.float_division.sts new file mode 100644 index 000000000..530c28c15 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/02.division_operator/tbd.float_division.sts @@ -0,0 +1,3 @@ +/*--- +desc: Float numbers division +---*/ \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/02.division_operator/tbd.int_div_overflow.sts b/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/02.division_operator/tbd.int_div_overflow.sts new file mode 100644 index 000000000..3f0af2948 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/02.division_operator/tbd.int_div_overflow.sts @@ -0,0 +1,3 @@ +/*--- +desc: Integer division with overflow +---*/ \ No newline at end of file -- Gitee From fed1fc462f38047190aec034642597617703cf96 Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Thu, 18 Aug 2022 13:54:16 +0300 Subject: [PATCH 24/84] Add remainder tests --- .../integer_remainder.sts | 10 +++++++ .../list.integer_mod.yaml | 18 +++++++++++++ .../03.remainder_operator/list.nan_inf.yaml | 27 +++++++++++++++++++ .../03.remainder_operator/nan_inf.sts | 11 ++++++++ 4 files changed, 66 insertions(+) create mode 100644 migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/03.remainder_operator/integer_remainder.sts create mode 100644 migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/03.remainder_operator/list.integer_mod.yaml create mode 100644 migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/03.remainder_operator/list.nan_inf.yaml create mode 100644 migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/03.remainder_operator/nan_inf.sts diff --git a/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/03.remainder_operator/integer_remainder.sts b/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/03.remainder_operator/integer_remainder.sts new file mode 100644 index 000000000..869ee87df --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/03.remainder_operator/integer_remainder.sts @@ -0,0 +1,10 @@ +{% for ni in integer_mod %} +/*--- +desc: Remainder of integer numbers +params: {{.ni.x}} % {{.ni.y}} == {{.ni.result}} +---*/ + +function main(): void { + assert {{.ni.x}} % {{.ni.y}} == {{.ni.result}}; +} +{% endfor %} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/03.remainder_operator/list.integer_mod.yaml b/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/03.remainder_operator/list.integer_mod.yaml new file mode 100644 index 000000000..9026910fe --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/03.remainder_operator/list.integer_mod.yaml @@ -0,0 +1,18 @@ +--- # List of integer remainder tests + +- {x: 0, y: 1, result: 0} +- {x: 1, y: 1, result: 0} +- {x: 0, y: -1, result: 0} +- {x: -1, y: -1, result: 0} + +- {x: 2, y: 2, result: 0} +- {x: 2, y: 1, result: 0} +- {x: 1, y: 2, result: 1} +- {x: 2, y: -1, result: 0} +- {x: -2, y: 1, result: 0} + +- {x: 5, y: 2, result: 1} +- {x: 7, y: 2, result: 1} +- {x: 7, y: 3, result: 1} +- {x: 3, y: 7, result: 3} +- {x: 8, y: 3, result: 2} diff --git a/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/03.remainder_operator/list.nan_inf.yaml b/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/03.remainder_operator/list.nan_inf.yaml new file mode 100644 index 000000000..d4a77a92c --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/03.remainder_operator/list.nan_inf.yaml @@ -0,0 +1,27 @@ +--- # List of remainder tests where NaN and INF involved + +- {x: NaN, y: NaN, result: NaN} +- {x: NaN, y: 1.0, result: NaN} +- {x: 1.0, y: NaN, result: NaN} +- {x: NaN, y: -1.0, result: NaN} +- {x: NaN, y: INF, result: NaN} +- {x: INF, y: NaN, result: NaN} +- {x: NaN, y: -INF, result: NaN} +- {x: -INF, y: NaN, result: NaN} + +- {x: INF, y: 1.0, result: NaN} +- {x: -INF, y: 1.0, result: NaN} +- {x: 1.0, y: 0.0, result: NaN} +- {x: -1.0, y: 0.0, result: NaN} + +- {x: 1.0, y: INF, result: 1.0} +- {x: -1.0, y: -INF, result: -1.0} + +- {x: 0.0, y: 1.0, result: 0.0} +- {x: 0.0, y: -1.0, result: 0.0} + +- {x: 1.0, y: 1.0, result: 0.0} +- {x: 1.0, y: -1.0, result: 0.0} + +- {x: 2.0, y: 0.5, result: 0.0} +- {x: -2.0, y: 0.5, result: -0.0} diff --git a/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/03.remainder_operator/nan_inf.sts b/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/03.remainder_operator/nan_inf.sts new file mode 100644 index 000000000..1bb8ba40e --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/03.remainder_operator/nan_inf.sts @@ -0,0 +1,11 @@ +{% for ni in nan_inf %} +/*--- +desc: Remainder with NaN, INF and zeroes +params: {{.ni.x}} % {{.ni.y}} == {{.ni.result}} +corner-case: true +---*/ + +function main(): void { + assert {{.ni.x}} % {{.ni.y}} == {{.ni.result}}; +} +{% endfor %} \ No newline at end of file -- Gitee From 79da9aac7164ace5dca5f7d91dce6172aa51cdea Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Thu, 18 Aug 2022 15:16:49 +0300 Subject: [PATCH 25/84] Add string concatenation tests --- .../list.string_concat.yaml | 9 +++++++++ .../string_concat.sts | 11 +++++++++++ 2 files changed, 20 insertions(+) create mode 100644 migrator/test/staticTS/CTS/07.expressions/20.additive_operators/01.string_concatenation_operator/list.string_concat.yaml create mode 100644 migrator/test/staticTS/CTS/07.expressions/20.additive_operators/01.string_concatenation_operator/string_concat.sts diff --git a/migrator/test/staticTS/CTS/07.expressions/20.additive_operators/01.string_concatenation_operator/list.string_concat.yaml b/migrator/test/staticTS/CTS/07.expressions/20.additive_operators/01.string_concatenation_operator/list.string_concat.yaml new file mode 100644 index 000000000..2b70c3f5b --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/20.additive_operators/01.string_concatenation_operator/list.string_concat.yaml @@ -0,0 +1,9 @@ +--- # List of string concatenation operation tests + +- {x: "\"\"", y: "\"\"", result: "\"\""} +- {x: "\"\"", y: "\"a\"", result: "\"a\""} +- {x: "\"a\"", y: "\"\"", result: "\"a\""} +- {x: "\"a\"", y: "\"a\"", result: "\"aa\""} +- {x: "\"aaa\"", y: "\"AAA\"", result: "\"aaaAAA\""} + +- {x: "\"фыва\"", y: "\"ФЫВА\"", result: "\"фываФЫВА\""} # Text in Russian diff --git a/migrator/test/staticTS/CTS/07.expressions/20.additive_operators/01.string_concatenation_operator/string_concat.sts b/migrator/test/staticTS/CTS/07.expressions/20.additive_operators/01.string_concatenation_operator/string_concat.sts new file mode 100644 index 000000000..f0d2c63a3 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/20.additive_operators/01.string_concatenation_operator/string_concat.sts @@ -0,0 +1,11 @@ +{% for sc in string_concat %} +/*--- +desc: String concatenation +params: | + {{.sc.x}} + {{.sc.y}} == {{.sc.result}} +---*/ + +function main(): void { + assert ({{.sc.x}} + {{.sc.y}}) == {{.sc.result}}; +} +{% endfor %} \ No newline at end of file -- Gitee From 6e19fae61704b11e34f28a991095fe8890dcfef5 Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Thu, 18 Aug 2022 15:29:15 +0300 Subject: [PATCH 26/84] Add additive tests --- .../list.nan_inf.yaml | 16 ++++++++++++++++ .../nan_inf.sts | 11 +++++++++++ 2 files changed, 27 insertions(+) create mode 100644 migrator/test/staticTS/CTS/07.expressions/20.additive_operators/02.additive_operators_for_numeric_types/list.nan_inf.yaml create mode 100644 migrator/test/staticTS/CTS/07.expressions/20.additive_operators/02.additive_operators_for_numeric_types/nan_inf.sts diff --git a/migrator/test/staticTS/CTS/07.expressions/20.additive_operators/02.additive_operators_for_numeric_types/list.nan_inf.yaml b/migrator/test/staticTS/CTS/07.expressions/20.additive_operators/02.additive_operators_for_numeric_types/list.nan_inf.yaml new file mode 100644 index 000000000..4e400d58d --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/20.additive_operators/02.additive_operators_for_numeric_types/list.nan_inf.yaml @@ -0,0 +1,16 @@ +--- # List of addition tests where NaN, INF and zeroes involved + +- {x: NaN, y: NaN, result: NaN} +- {x: 0.0, y: NaN, result: NaN} +- {x: NaN, y: 0.0, result: NaN} +- {x: -INF, y: INF, result: NaN} +- {x: INF, y: -INF, result: NaN} +- {x: -INF, y: 1.0, result: -INF} +- {x: INF, y: 1.0, result: INF} +- {x: 0.0, y: -0.0, result: 0.0} +- {x: -0.0, y: 0.0, result: 0.0} +- {x: -0.0, y: -0.0, result: -0.0} +- {x: 0.0, y: 0.0, result: 0.0} +- {x: 0.0, y: 1.0, result: 1.0} +- {x: 1.0, y: 0.0, result: 1.0} +- {x: 1.0, y: -1.0, result: 0.0} diff --git a/migrator/test/staticTS/CTS/07.expressions/20.additive_operators/02.additive_operators_for_numeric_types/nan_inf.sts b/migrator/test/staticTS/CTS/07.expressions/20.additive_operators/02.additive_operators_for_numeric_types/nan_inf.sts new file mode 100644 index 000000000..f3be1258b --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/20.additive_operators/02.additive_operators_for_numeric_types/nan_inf.sts @@ -0,0 +1,11 @@ +{% for ni in nan_inf %} +/*--- +desc: Additions with NaN and INF +params: {{.ni.x}} + {{.ni.y}} == {{.ni.result}} +corner-case: true +---*/ + +function main(): void { + assert ({{.ni.x}} + {{.ni.y}}) == {{.ni.result}}; +} +{% endfor %} \ No newline at end of file -- Gitee From e11c3c143e48a9e4b8561c5dfbd9c438eefa7612 Mon Sep 17 00:00:00 2001 From: Shumilov Petr Date: Thu, 18 Aug 2022 22:06:19 +0300 Subject: [PATCH 27/84] Add the prototype of machine-readable spec format --- migrator/test/staticTS/example.spec.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 migrator/test/staticTS/example.spec.yaml diff --git a/migrator/test/staticTS/example.spec.yaml b/migrator/test/staticTS/example.spec.yaml new file mode 100644 index 000000000..02eb793e7 --- /dev/null +++ b/migrator/test/staticTS/example.spec.yaml @@ -0,0 +1,15 @@ +--- +- name: 1.INTRODUCTION +- name: 2.LEXICAL ELEMENTS + children: + - name: 1.COMMENTS + desc: asdas + - name: 2.TOKENS + desc: asdasd123 + children: + - name: 1.WHITESPACES + desc: asdas12321 + - name: 2.LINE SEPARATORS + desc: asdasd + - name: 3.IDENTIFIERS + desc: sdfsdfs -- Gitee From 7aa7fefc6dac1a4bf7f141a4950e3763d7a309d6 Mon Sep 17 00:00:00 2001 From: Shumilov Petr Date: Thu, 18 Aug 2022 22:07:14 +0300 Subject: [PATCH 28/84] Add read_file into utils --- migrator/test/staticTS/formatChecker/utils/fsutils.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/migrator/test/staticTS/formatChecker/utils/fsutils.py b/migrator/test/staticTS/formatChecker/utils/fsutils.py index ff90ec775..aee0aa7cc 100644 --- a/migrator/test/staticTS/formatChecker/utils/fsutils.py +++ b/migrator/test/staticTS/formatChecker/utils/fsutils.py @@ -20,4 +20,10 @@ def iter_files(dirpath: str, allowed_ext: List[str]): def write_file(path, text): with open(path, "w+", encoding="utf8") as f: - f.write(text) \ No newline at end of file + f.write(text) + +def read_file(path) -> str: + text = "" + with open(path, "r", encoding='utf8') as f: + text = f.read() + return text \ No newline at end of file -- Gitee From eaedae7d66ffceef188a2449a6c4d87d76bac4fe Mon Sep 17 00:00:00 2001 From: Shumilov Petr Date: Thu, 18 Aug 2022 22:08:23 +0300 Subject: [PATCH 29/84] Add reader for machine-readable spec format --- .../test/staticTS/formatChecker/utils/spec.py | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 migrator/test/staticTS/formatChecker/utils/spec.py diff --git a/migrator/test/staticTS/formatChecker/utils/spec.py b/migrator/test/staticTS/formatChecker/utils/spec.py new file mode 100644 index 000000000..4b758bd61 --- /dev/null +++ b/migrator/test/staticTS/formatChecker/utils/spec.py @@ -0,0 +1,47 @@ +import yaml +from utils.file_structure import TestDirectory +from utils.exceptions import InvalidFileFormatException +from utils.constants import SPEC_SECTION_TITLE_FIELD_NAME, SPEC_SUBSECTIONS_FIELD_NAME +from utils.fsutils import read_file +from pathlib import Path + +Spec = dict + +def build_spec_tree(specpath: str, root: TestDirectory): + spec = __parse_spec(specpath) + walk_spec(spec, root, specpath=specpath) + + +def walk_spec(spec: list, parent: TestDirectory, specpath: str): + if type(spec) != list: + raise InvalidFileFormatException(message="Spec sections list must be a YAML list", filepath=specpath) + + for s in spec: + if type(s) != dict: + raise InvalidFileFormatException(message="Spec section must be a YAML dict", filepath=specpath) + + s = dict(s) + if not SPEC_SECTION_TITLE_FIELD_NAME in s: + raise InvalidFileFormatException(message=f"Spec section must contain the '{SPEC_SECTION_TITLE_FIELD_NAME}' field", filepath=specpath) + + # Denormalize name + # TODO: make a sepate method + name = str(s[SPEC_SECTION_TITLE_FIELD_NAME]).replace(" ", "_").lower() + + td = TestDirectory(path=(parent.path / Path(name)), parent=parent) + parent.add_subdir(td) + + # Has subsections? + if SPEC_SUBSECTIONS_FIELD_NAME in s: + walk_spec(s[SPEC_SUBSECTIONS_FIELD_NAME], parent=td, specpath=specpath) + + +def __parse_spec(path: str) -> Spec: + text = read_file(path) + + try: + spec = yaml.load(text, Loader=yaml.FullLoader) + except Exception as e: + raise InvalidFileFormatException(message=f"Could not load YAML: {str(e)}", filepath=path) + + return spec \ No newline at end of file -- Gitee From 8b454712265c4bf96388ebd61b650e7463c3a4e0 Mon Sep 17 00:00:00 2001 From: Shumilov Petr Date: Thu, 18 Aug 2022 22:09:41 +0300 Subject: [PATCH 30/84] Refactor utils for coverage calculation --- .../staticTS/formatChecker/utils/constants.py | 6 +- .../formatChecker/utils/file_structure.py | 66 ++++++++++++++++--- .../staticTS/formatChecker/utils/test_case.py | 2 +- .../formatChecker/utils/test_parameters.py | 6 +- 4 files changed, 66 insertions(+), 14 deletions(-) diff --git a/migrator/test/staticTS/formatChecker/utils/constants.py b/migrator/test/staticTS/formatChecker/utils/constants.py index 4afc98d27..7d52e295a 100644 --- a/migrator/test/staticTS/formatChecker/utils/constants.py +++ b/migrator/test/staticTS/formatChecker/utils/constants.py @@ -18,4 +18,8 @@ NEGATIVE_PREFIX = "n." SKIP_PREFIX = "tbd." # Jinja -VARIABLE_START_STRING = "{{." \ No newline at end of file +VARIABLE_START_STRING = "{{." + +# Spec +SPEC_SECTION_TITLE_FIELD_NAME = "name" +SPEC_SUBSECTIONS_FIELD_NAME = "children" \ No newline at end of file diff --git a/migrator/test/staticTS/formatChecker/utils/file_structure.py b/migrator/test/staticTS/formatChecker/utils/file_structure.py index bbbbb0bf4..9222bc15f 100644 --- a/migrator/test/staticTS/formatChecker/utils/file_structure.py +++ b/migrator/test/staticTS/formatChecker/utils/file_structure.py @@ -13,22 +13,32 @@ from utils.exceptions import InvalidFileStructureException @dataclass() class TestDirectory: - parent: Union['TestDirectory', None] + id: int path: Path + name: str - cur_section_index: int - section_name: str + parent: Union['TestDirectory', None] + subdirs: 'List[TestDirectory]' + + + def __init__(self, path: Path, id: int = 0, name: str = "", parent: Union['TestDirectory', None] = None, subdirs: 'List[TestDirectory]' = []) -> None: + self.path = path - def __init__(self, path: Path, parent: Union['TestDirectory', None] = None) -> None: + if id == 0 or name == "": + self.id, self.name = parse_section_dir_name(path) + else: + self.id = id + self.name = name + self.parent = parent - self.path = path - self.cur_section_index, self.section_name = parse_section_dir_name(path) + self.subdirs = list(subdirs) + def full_index(self) -> List[int]: cur = self result = [] while (cur is not None): - result.append(cur.cur_section_index) + result.append(cur.id) cur = cur.parent return list(reversed(result)) @@ -38,6 +48,22 @@ class TestDirectory: if len(allowed_ext) > 0 and filepath.suffix not in allowed_ext: continue yield filepath + + def add_subdir(self, td: 'TestDirectory'): + td.parent = self + self.subdirs.append(td) + + def find_subdir_by_name(self, name: str) -> Union['TestDirectory', None]: + for sd in self.subdirs: + if sd.name == name: + return sd + return None + + def find_subdir_by_id(self, id: int) -> Union['TestDirectory', None]: + for sd in self.subdirs: + if sd.id == id: + return sd + return None def is_empty(self): return len(os.listdir(str(self.path))) == 0 @@ -52,7 +78,7 @@ def walk_test_subdirs(path: Path, parent=None) -> Iterable[TestDirectory]: for name in os.listdir(str(path)): if (path / name).is_dir(): subdirs.append(TestDirectory(parent=parent, path=(path / name))) - subdirs = sorted(subdirs, key=lambda dir: dir.cur_section_index) + subdirs = sorted(subdirs, key=lambda dir: dir.id) for subdir in subdirs: yield subdir @@ -61,6 +87,30 @@ def walk_test_subdirs(path: Path, parent=None) -> Iterable[TestDirectory]: yield subsubdir +def build_directory_tree(td: TestDirectory): + subdirs = [] + for name in os.listdir(str(td.path)): + if (td.path / name).is_dir(): + subdirs.append(TestDirectory(parent=td, path=(td.path / name))) + subdirs = sorted(subdirs, key=lambda dir: dir.id) + + for sd in subdirs: + td.add_subdir(sd) + build_directory_tree(sd) + + +def print_tree(td: TestDirectory): + for sd in td.subdirs: + + left_space = " " * 2 * len(sd.full_index()) + section_index = str(sd.id) + section_name = sd.name.replace("_", " ").title() + right_space = 90 - len(left_space) - len(section_index) - len(section_name) + + print(left_space, section_index, section_name, "." * right_space, "\n") + print_tree(sd) + + def parse_section_dir_name(path: Path) -> Tuple[int, str]: parts = path.name.split(".") if len(parts) == 1: diff --git a/migrator/test/staticTS/formatChecker/utils/test_case.py b/migrator/test/staticTS/formatChecker/utils/test_case.py index 4a5c5ff29..c2e02b19a 100644 --- a/migrator/test/staticTS/formatChecker/utils/test_case.py +++ b/migrator/test/staticTS/formatChecker/utils/test_case.py @@ -11,7 +11,7 @@ def is_negative(path: Path) -> bool: def should_be_skipped(path: Path) -> bool: - return path.name.startswith(SKIP_PREFIXES) + return path.name.startswith(SKIP_PREFIX) def strip_template(path: Path) -> Tuple[str, int]: diff --git a/migrator/test/staticTS/formatChecker/utils/test_parameters.py b/migrator/test/staticTS/formatChecker/utils/test_parameters.py index eb144e3b9..0d2d01ddf 100644 --- a/migrator/test/staticTS/formatChecker/utils/test_parameters.py +++ b/migrator/test/staticTS/formatChecker/utils/test_parameters.py @@ -5,7 +5,7 @@ import yaml import os.path as ospath from utils.exceptions import InvalidFileFormatException -from utils.fsutils import iter_files +from utils.fsutils import iter_files, read_file from utils.constants import YAML_EXTENSIONS, LIST_PREFIX @@ -32,9 +32,7 @@ def __parse_yaml_list(path: str) -> Params: Parses a single YAML list of parameters Verifies that it is a list """ - # TODO: Move to fsutils - with open(path, "r", encoding='utf8') as f: - text = f.read() + text = read_file(path) try: params = yaml.load(text, Loader=yaml.FullLoader) -- Gitee From 7de861d7084bf639d59ddba9f5727825d26ed674 Mon Sep 17 00:00:00 2001 From: Shumilov Petr Date: Thu, 18 Aug 2022 22:10:10 +0300 Subject: [PATCH 31/84] Add automatic coverage calculation --- .../test/staticTS/formatChecker/coverage.py | 101 ++++++++++++++++-- 1 file changed, 93 insertions(+), 8 deletions(-) diff --git a/migrator/test/staticTS/formatChecker/coverage.py b/migrator/test/staticTS/formatChecker/coverage.py index 27cf66334..8c5e496a3 100644 --- a/migrator/test/staticTS/formatChecker/coverage.py +++ b/migrator/test/staticTS/formatChecker/coverage.py @@ -1,11 +1,13 @@ +from math import fabs from pathlib import Path import argparse +from typing import Tuple from utils.constants import TEMPLATE_EXTENSION from utils.test_case import is_negative, strip_template -from utils.file_structure import TestDirectory, walk_test_subdirs - - +from utils.file_structure import TestDirectory, walk_test_subdirs, build_directory_tree, print_tree +from utils.spec import build_spec_tree + def count_tests(dir: TestDirectory): pos_tests = 0 neg_tests = 0 @@ -21,12 +23,12 @@ def count_tests(dir: TestDirectory): return pos_tests, neg_tests, len(templates) -def coverage(testpath: Path): +def print_table_of_contents(testpath: Path): total_templates = 0 total_positive_tests = 0 total_negative_tests = 0 - print("Coverage:\n") + print("Table of contents:\n") for dir in walk_test_subdirs(testpath): full_index = dir.full_index() depth = len(full_index) @@ -40,17 +42,91 @@ def coverage(testpath: Path): # Print left_space = " " * 2 * depth section_index = ".".join([str(i) for i in full_index]) - section_name = dir.section_name.replace("_", " ").title() + section_name = dir.name.replace("_", " ").title() right_space = 90 - len(left_space) - len(section_index) - len(section_name) if not dir.is_empty(): print(left_space, section_index, section_name, "." * right_space, f"templates: {n_templates}; tests: {pos_tests} pos, {neg_tests} neg.\n") print("\n=====") - print(f"TOTAL TEMPLATES {total_templates} | TOTAL POSITIVE TESTS {total_positive_tests} | TOTAL NEGATIVE TESTS {total_negative_tests}") + print(f"TOTAL TESTS {total_positive_tests + total_negative_tests} | TOTAL TEMPLATES {total_templates} | TOTAL POSITIVE TESTS {total_positive_tests} | TOTAL NEGATIVE TESTS {total_negative_tests}") + + +def find_diffs(test: TestDirectory, ethalon: TestDirectory, strict: bool = False, silent: bool = False): + diff_detected = False + + for esd in ethalon.subdirs: + tsd = test.find_subdir_by_name(esd.name) + + esd_index = esd.full_index() + esd_section_index = ".".join([str(i) for i in esd_index][1:]) + esd_section_name = esd.name.replace("_", " ").title() + + if tsd is None: + diff_detected = True + if not strict: + tsd = test.find_subdir_by_id(esd.id) + if not tsd is None and not find_diffs(tsd, esd, strict=True, silent=True): + tsd_section_name = tsd.name.replace("_", " ").title() + if not silent: + print(f"[Missmath]: Subsection's name missmath [{esd_section_index}]: '{esd_section_name}' (spec) != '{tsd_section_name}' (tests).") + else: + if not silent: + print(f"[NotFound]: Subsection [{esd_section_index}.{esd_section_name}] not fould in tests.") + + continue + + if tsd.id != esd.id: + diff_detected = True + + tsd_index = tsd.full_index() + tsd_section_index = ".".join([str(i) for i in tsd_index][1:]) + tsd_section_name = tsd.name.replace("_", " ").title() + + if not strict: + if not find_diffs(tsd, esd, strict=True, silent=True): + if not silent: + print(f"[Missmath]: Index missmath for [{esd_section_name}]: {esd_section_index} (spec) != {tsd_section_index} (tests) but content is equal.") + else: + if not silent: + print(f"[Missmath]: Subsection [{tsd_section_index}.{tsd_section_name}] from tests has a different index and content in compare with [{esd_section_index}.{esd_section_name}] from spec.") + continue + + find_diffs(tsd, esd) + + return diff_detected + + +def calc_tests_and_spec_stat(test: TestDirectory, spec: TestDirectory, tnum: int = 0, snum: int = 0)-> Tuple[int, int]: + for esd in spec.subdirs: + snum += 1 + tsd = test.find_subdir_by_name(esd.name) + + if not tsd is None and tsd.id == esd.id: + tnum += 1 + tnum, snum = calc_tests_and_spec_stat(tsd, esd, tnum, snum) + + return tnum, snum + + +def coverage(testpath: Path, specpath: Path): + ethalon_tree = TestDirectory(id=-1, name="root", path="", parent=None) + build_spec_tree(specpath=specpath, root=ethalon_tree) + + test_tree = TestDirectory(id=-1, name="root", path=testpath, parent=None) + build_directory_tree(test_tree) + + print(f"=====\nDIFF tests='{str(testpath)}'; spec='{str(specpath)}'") + find_diffs(test_tree, ethalon_tree) + + testsNum, specNum = calc_tests_and_spec_stat(test_tree, ethalon_tree) + coverage = int(float(testsNum) / float(specNum) * 100) + print(f"=====\nCOVEARGE: {coverage}%") + parser = argparse.ArgumentParser(description='Run CTS tests.') parser.add_argument('tests_dir', help='Path to directory that contains the tests.') +parser.add_argument('--specpath', help='Path to file with STS specification in YAML format.', required=False) def main(): @@ -62,8 +138,17 @@ def main(): if not testpath.is_dir(): print(f"ERROR: Path '{testpath}' must point to a directory") exit(1) + + print_table_of_contents(testpath) + + if not args.specpath is None: + specpath = Path(args.specpath) + + if not specpath.is_file(): + print(f"ERROR: Path '{specpath}' must point to a file with STS spec") + exit(1) - coverage(testpath) + coverage(testpath, specpath) if __name__ == "__main__": -- Gitee From 7638ad3c55ed6c2d852edc09617f250adc7e5420 Mon Sep 17 00:00:00 2001 From: Shumilov Petr Date: Thu, 18 Aug 2022 22:15:03 +0300 Subject: [PATCH 32/84] Fix README --- migrator/test/staticTS/formatChecker/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migrator/test/staticTS/formatChecker/README.md b/migrator/test/staticTS/formatChecker/README.md index 6d9cb1564..436a53fcb 100644 --- a/migrator/test/staticTS/formatChecker/README.md +++ b/migrator/test/staticTS/formatChecker/README.md @@ -19,7 +19,7 @@ In `Format Checker` we try to stabilize this format by implementing a Proof of C 4. Run tests: `python3 formatChecker/run_tests.py ./formatChecker/output ../../out/migrator-0.1.jar` -5. Get coverage: `python3 formatChecker/coverage.py ./formatChecker/output` +5. Get coverage: `python3 formatChecker/coverage.py ./formatChecker/output [--specpath=./example.spec.yaml]` ## File Structure -- Gitee From 24c599b8043eebbd7d6ec2d1917f5ee9ff1c7ef3 Mon Sep 17 00:00:00 2001 From: Shumilov Petr Date: Thu, 18 Aug 2022 22:16:22 +0300 Subject: [PATCH 33/84] Add Introduction section into CTS for consistency --- migrator/test/staticTS/CTS/01.introduction/.gitkeep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 migrator/test/staticTS/CTS/01.introduction/.gitkeep diff --git a/migrator/test/staticTS/CTS/01.introduction/.gitkeep b/migrator/test/staticTS/CTS/01.introduction/.gitkeep new file mode 100644 index 000000000..e69de29bb -- Gitee From 5ea0822479f147e0548bb78fdd7d111c9ad2b892 Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Tue, 23 Aug 2022 12:57:40 +0300 Subject: [PATCH 34/84] Add unique decl tests --- .../02.declarations/list.unique_decl.yaml | 5 +++++ .../02.declarations/n.unique_block_decl.sts | 10 ++++++++++ .../02.declarations/n.unique_class_decl.sts | 10 ++++++++++ .../02.declarations/n.unique_decl_name.sts | 11 +++++++++++ .../02.declarations/n.unique_enum_decl.sts | 7 +++++++ .../02.declarations/n.unique_func_decl.sts | 8 ++++++++ .../02.declarations/n.unique_intf_decl.sts | 10 ++++++++++ 7 files changed, 61 insertions(+) create mode 100644 migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/list.unique_decl.yaml create mode 100644 migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/n.unique_block_decl.sts create mode 100644 migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/n.unique_class_decl.sts create mode 100644 migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/n.unique_decl_name.sts create mode 100644 migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/n.unique_enum_decl.sts create mode 100644 migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/n.unique_func_decl.sts create mode 100644 migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/n.unique_intf_decl.sts diff --git a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/list.unique_decl.yaml b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/list.unique_decl.yaml new file mode 100644 index 000000000..65e53847e --- /dev/null +++ b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/list.unique_decl.yaml @@ -0,0 +1,5 @@ +--- # List of declarations to be unique + +- "class A{}" +- "enum E {V1, V2}" +- "function f(): void {}" diff --git a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/n.unique_block_decl.sts b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/n.unique_block_decl.sts new file mode 100644 index 000000000..c714485fc --- /dev/null +++ b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/n.unique_block_decl.sts @@ -0,0 +1,10 @@ +/*--- +desc: A name must be unique in its block space +---*/ + +function main(): void { + { + let x = 0; + let x = 0; + } +} diff --git a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/n.unique_class_decl.sts b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/n.unique_class_decl.sts new file mode 100644 index 000000000..f3c95ac90 --- /dev/null +++ b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/n.unique_class_decl.sts @@ -0,0 +1,10 @@ +/*--- +desc: A name must be unique in its class space +---*/ + +class A { + x: int; + x: int; +} + +function main(): void {} diff --git a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/n.unique_decl_name.sts b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/n.unique_decl_name.sts new file mode 100644 index 000000000..51feaf769 --- /dev/null +++ b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/n.unique_decl_name.sts @@ -0,0 +1,11 @@ +{% for un in unique_decl %} +/*--- +desc: A name must be unique in its declaration space +---*/ + +{{.un}} +{{.un}} + +function main(): void {} + +{% endfor %} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/n.unique_enum_decl.sts b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/n.unique_enum_decl.sts new file mode 100644 index 000000000..cb7fb7550 --- /dev/null +++ b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/n.unique_enum_decl.sts @@ -0,0 +1,7 @@ +/*--- +desc: A name must be unique in its enum space +---*/ + +enum E {V1, V1} + +function main(): void {} diff --git a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/n.unique_func_decl.sts b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/n.unique_func_decl.sts new file mode 100644 index 000000000..91f0571e5 --- /dev/null +++ b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/n.unique_func_decl.sts @@ -0,0 +1,8 @@ +/*--- +desc: A name must be unique in its function space +---*/ + +function main(): void { + let x = 0; + let x = 0; +} diff --git a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/n.unique_intf_decl.sts b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/n.unique_intf_decl.sts new file mode 100644 index 000000000..e9f0b79c6 --- /dev/null +++ b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/n.unique_intf_decl.sts @@ -0,0 +1,10 @@ +/*--- +desc: A name must be unique in its interface space +---*/ + +interface A { + x: int = 0; + x: int = 0; +} + +function main(): void {} -- Gitee From b8dc74797214ee4f676b615eaaba6dc981407758 Mon Sep 17 00:00:00 2001 From: Shumilov Petr Date: Wed, 24 Aug 2022 16:52:47 +0300 Subject: [PATCH 35/84] Add section name normalize and denormalize utils --- .../formatChecker/utils/file_structure.py | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/migrator/test/staticTS/formatChecker/utils/file_structure.py b/migrator/test/staticTS/formatChecker/utils/file_structure.py index 9222bc15f..5c7198f49 100644 --- a/migrator/test/staticTS/formatChecker/utils/file_structure.py +++ b/migrator/test/staticTS/formatChecker/utils/file_structure.py @@ -2,10 +2,10 @@ # The entrypoint is the function 'walk_test_subdirs' from dataclasses import dataclass -from pathlib import Path -from re import sub +from pathlib import Path from typing import Iterable, Tuple, List, Union import os +import re import os.path as ospath from utils.exceptions import InvalidFileStructureException @@ -54,12 +54,14 @@ class TestDirectory: self.subdirs.append(td) def find_subdir_by_name(self, name: str) -> Union['TestDirectory', None]: + # TODO: decrease complexity for sd in self.subdirs: if sd.name == name: return sd return None def find_subdir_by_id(self, id: int) -> Union['TestDirectory', None]: + # TODO: decrease complexity for sd in self.subdirs: if sd.id == id: return sd @@ -99,6 +101,7 @@ def build_directory_tree(td: TestDirectory): build_directory_tree(sd) + def print_tree(td: TestDirectory): for sd in td.subdirs: @@ -111,6 +114,21 @@ def print_tree(td: TestDirectory): print_tree(sd) +def normalize_section_name(name: str) -> str: + parts = name.split(".") + if len(parts) != 2: + raise InvalidFileStructureException(filepath=name, message="Invalid section name format") + first, second = parts + if not first.isdigit(): + raise InvalidFileStructureException(filepath=name, message="Invalid section name format") + second = second.replace(" ", "_").replace("-", "_").lower() + return first + "." + "".join([c for c in second if c.isalpha() or c == "_"]) + + +def denormalize_section_name(name: str) -> str: + return name.replace("_", " ").title() + + def parse_section_dir_name(path: Path) -> Tuple[int, str]: parts = path.name.split(".") if len(parts) == 1: @@ -122,7 +140,7 @@ def parse_section_dir_name(path: Path) -> Tuple[int, str]: first, second = parts if not first.isdigit(): raise InvalidFileStructureException(filepath=str(path), message="Invalid directory name format") - if not second.islower() or ' ' in second: + if not re.match("^[a-z_]*$", second): raise InvalidFileStructureException(filepath=str(path), message="Section name must be lowercase and contain spaces") return int(first), second -- Gitee From 947e7132b34eb325800eafff23068c1c5bcd3cb0 Mon Sep 17 00:00:00 2001 From: Shumilov Petr Date: Wed, 24 Aug 2022 16:54:27 +0300 Subject: [PATCH 36/84] Make find_diffs more clear --- migrator/test/staticTS/formatChecker/coverage.py | 11 ++++++----- migrator/test/staticTS/formatChecker/utils/spec.py | 9 ++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/migrator/test/staticTS/formatChecker/coverage.py b/migrator/test/staticTS/formatChecker/coverage.py index 8c5e496a3..bee24887d 100644 --- a/migrator/test/staticTS/formatChecker/coverage.py +++ b/migrator/test/staticTS/formatChecker/coverage.py @@ -5,7 +5,7 @@ from typing import Tuple from utils.constants import TEMPLATE_EXTENSION from utils.test_case import is_negative, strip_template -from utils.file_structure import TestDirectory, walk_test_subdirs, build_directory_tree, print_tree +from utils.file_structure import TestDirectory, walk_test_subdirs, build_directory_tree, print_tree, denormalize_section_name from utils.spec import build_spec_tree def count_tests(dir: TestDirectory): @@ -42,7 +42,7 @@ def print_table_of_contents(testpath: Path): # Print left_space = " " * 2 * depth section_index = ".".join([str(i) for i in full_index]) - section_name = dir.name.replace("_", " ").title() + section_name = denormalize_section_name(dir.name) right_space = 90 - len(left_space) - len(section_index) - len(section_name) if not dir.is_empty(): print(left_space, section_index, section_name, "." * right_space, f"templates: {n_templates}; tests: {pos_tests} pos, {neg_tests} neg.\n") @@ -59,14 +59,14 @@ def find_diffs(test: TestDirectory, ethalon: TestDirectory, strict: bool = False esd_index = esd.full_index() esd_section_index = ".".join([str(i) for i in esd_index][1:]) - esd_section_name = esd.name.replace("_", " ").title() + esd_section_name = denormalize_section_name(esd.name) if tsd is None: diff_detected = True if not strict: tsd = test.find_subdir_by_id(esd.id) if not tsd is None and not find_diffs(tsd, esd, strict=True, silent=True): - tsd_section_name = tsd.name.replace("_", " ").title() + tsd_section_name = denormalize_section_name(tsd.name) if not silent: print(f"[Missmath]: Subsection's name missmath [{esd_section_index}]: '{esd_section_name}' (spec) != '{tsd_section_name}' (tests).") else: @@ -80,7 +80,7 @@ def find_diffs(test: TestDirectory, ethalon: TestDirectory, strict: bool = False tsd_index = tsd.full_index() tsd_section_index = ".".join([str(i) for i in tsd_index][1:]) - tsd_section_name = tsd.name.replace("_", " ").title() + tsd_section_name = denormalize_section_name(tsd.name) if not strict: if not find_diffs(tsd, esd, strict=True, silent=True): @@ -115,6 +115,7 @@ def coverage(testpath: Path, specpath: Path): test_tree = TestDirectory(id=-1, name="root", path=testpath, parent=None) build_directory_tree(test_tree) + #print_tree(ethalon_tree) print(f"=====\nDIFF tests='{str(testpath)}'; spec='{str(specpath)}'") find_diffs(test_tree, ethalon_tree) diff --git a/migrator/test/staticTS/formatChecker/utils/spec.py b/migrator/test/staticTS/formatChecker/utils/spec.py index 4b758bd61..7bfbf3ecf 100644 --- a/migrator/test/staticTS/formatChecker/utils/spec.py +++ b/migrator/test/staticTS/formatChecker/utils/spec.py @@ -1,5 +1,5 @@ import yaml -from utils.file_structure import TestDirectory +from utils.file_structure import TestDirectory, normalize_section_name from utils.exceptions import InvalidFileFormatException from utils.constants import SPEC_SECTION_TITLE_FIELD_NAME, SPEC_SUBSECTIONS_FIELD_NAME from utils.fsutils import read_file @@ -24,10 +24,9 @@ def walk_spec(spec: list, parent: TestDirectory, specpath: str): if not SPEC_SECTION_TITLE_FIELD_NAME in s: raise InvalidFileFormatException(message=f"Spec section must contain the '{SPEC_SECTION_TITLE_FIELD_NAME}' field", filepath=specpath) - # Denormalize name - # TODO: make a sepate method - name = str(s[SPEC_SECTION_TITLE_FIELD_NAME]).replace(" ", "_").lower() - + # Normalize name + name = normalize_section_name(str(s[SPEC_SECTION_TITLE_FIELD_NAME])) + td = TestDirectory(path=(parent.path / Path(name)), parent=parent) parent.add_subdir(td) -- Gitee From 57a25c0759495ae6a05373e34b28417d3ada2281 Mon Sep 17 00:00:00 2001 From: Shumilov Petr Date: Wed, 24 Aug 2022 16:57:52 +0300 Subject: [PATCH 37/84] Rename CTS section according to the spec --- .../{06.null_literal => 06.null_literals}/null_literal.sts | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename migrator/test/staticTS/CTS/02.lexical_elements/06.literals/{06.null_literal => 06.null_literals}/null_literal.sts (100%) diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/06.null_literal/null_literal.sts b/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/06.null_literals/null_literal.sts similarity index 100% rename from migrator/test/staticTS/CTS/02.lexical_elements/06.literals/06.null_literal/null_literal.sts rename to migrator/test/staticTS/CTS/02.lexical_elements/06.literals/06.null_literals/null_literal.sts -- Gitee From 258796bb190c147193c7d9eb39fff8571d11fc14 Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Thu, 25 Aug 2022 15:34:01 +0300 Subject: [PATCH 38/84] Add license terms to files --- .../test/staticTS/formatChecker/coverage.py | 17 ++++++++++++++++- .../test/staticTS/formatChecker/generate.py | 15 +++++++++++++++ .../test/staticTS/formatChecker/run_tests.py | 15 +++++++++++++++ migrator/test/staticTS/formatChecker/setup.sh | 15 +++++++++++++++ 4 files changed, 61 insertions(+), 1 deletion(-) diff --git a/migrator/test/staticTS/formatChecker/coverage.py b/migrator/test/staticTS/formatChecker/coverage.py index bee24887d..5950e1707 100644 --- a/migrator/test/staticTS/formatChecker/coverage.py +++ b/migrator/test/staticTS/formatChecker/coverage.py @@ -1,3 +1,18 @@ +# +# Copyright (c) 2022-2022 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + from math import fabs from pathlib import Path import argparse @@ -7,7 +22,7 @@ from utils.constants import TEMPLATE_EXTENSION from utils.test_case import is_negative, strip_template from utils.file_structure import TestDirectory, walk_test_subdirs, build_directory_tree, print_tree, denormalize_section_name from utils.spec import build_spec_tree - + def count_tests(dir: TestDirectory): pos_tests = 0 neg_tests = 0 diff --git a/migrator/test/staticTS/formatChecker/generate.py b/migrator/test/staticTS/formatChecker/generate.py index 3b3886cd7..6cdc2271a 100644 --- a/migrator/test/staticTS/formatChecker/generate.py +++ b/migrator/test/staticTS/formatChecker/generate.py @@ -1,3 +1,18 @@ +# +# Copyright (c) 2022-2022 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + import argparse from email import message import os diff --git a/migrator/test/staticTS/formatChecker/run_tests.py b/migrator/test/staticTS/formatChecker/run_tests.py index 6850487ea..de8286f20 100644 --- a/migrator/test/staticTS/formatChecker/run_tests.py +++ b/migrator/test/staticTS/formatChecker/run_tests.py @@ -1,3 +1,18 @@ +# +# Copyright (c) 2022-2022 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + from dataclasses import dataclass from pathlib import Path from utils.file_structure import walk_test_subdirs diff --git a/migrator/test/staticTS/formatChecker/setup.sh b/migrator/test/staticTS/formatChecker/setup.sh index 0f8d3008d..7e87c4cbe 100755 --- a/migrator/test/staticTS/formatChecker/setup.sh +++ b/migrator/test/staticTS/formatChecker/setup.sh @@ -1,5 +1,20 @@ #!/bin/bash +# +# Copyright (c) 2022-2022 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + SCRIPT=`readlink -e $BASH_SOURCE` SCRIPT_DIR=`dirname $SCRIPT` -- Gitee From 9fa4337461b736b9ef196e45c39fe4555a49480f Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Thu, 25 Aug 2022 15:38:16 +0300 Subject: [PATCH 39/84] Remove unnecessary file --- .../02.declarations/tbd.n.unique_decl_name.sts | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/tbd.n.unique_decl_name.sts diff --git a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/tbd.n.unique_decl_name.sts b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/tbd.n.unique_decl_name.sts deleted file mode 100644 index a976cfb15..000000000 --- a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/tbd.n.unique_decl_name.sts +++ /dev/null @@ -1,3 +0,0 @@ -/*--- -desc: A name must be unique in its declaration space ----*/ \ No newline at end of file -- Gitee From 43d3ba57943fe5b9abb6b6a3fdbc3a64a4d1ce7c Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Thu, 25 Aug 2022 15:39:59 +0300 Subject: [PATCH 40/84] Add integer multiplication expr tests --- .../01.multiplication_operator/integer_mul.sts | 10 ++++++++++ .../list.integer_mul.yaml | 13 +++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/01.multiplication_operator/integer_mul.sts create mode 100644 migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/01.multiplication_operator/list.integer_mul.yaml diff --git a/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/01.multiplication_operator/integer_mul.sts b/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/01.multiplication_operator/integer_mul.sts new file mode 100644 index 000000000..1a72adb02 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/01.multiplication_operator/integer_mul.sts @@ -0,0 +1,10 @@ +{% for ni in integer_mul %} +/*--- +desc: Multiplication of integer numbers +params: {{.ni.x}} * {{.ni.y}} == {{.ni.result}} +---*/ + +function main(): void { + assert {{.ni.x}} * {{.ni.y}} == {{.ni.result}}; +} +{% endfor %} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/01.multiplication_operator/list.integer_mul.yaml b/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/01.multiplication_operator/list.integer_mul.yaml new file mode 100644 index 000000000..5dadd145f --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/01.multiplication_operator/list.integer_mul.yaml @@ -0,0 +1,13 @@ +--- # List of integer multiplication + +- {x: 0, y: 0, result: 0} +- {x: 0, y: 1, result: 0} +- {x: 1, y: 0, result: 0} +- {x: 0, y: -1, result: 0} +- {x: -1, y: 0, result: 0} + +- {x: 2, y: 2, result: 4} +- {x: 2, y: 1, result: 2} +- {x: 1, y: 2, result: 2} +- {x: 2, y: -1, result: -2} +- {x: -2, y: 1, result: -2} -- Gitee From 6042cca86151f2426bbe2a7d1831ebd1ac5f95d5 Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Thu, 25 Aug 2022 15:49:56 +0300 Subject: [PATCH 41/84] Add integer assoc tests --- .../int_parens.sts | 10 ++++++++++ .../list.int_assoc.yaml | 17 +++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 migrator/test/staticTS/CTS/07.expressions/06.evaluation_order/03.evaluation_respects_parentheses_and_precedence/int_parens.sts create mode 100644 migrator/test/staticTS/CTS/07.expressions/06.evaluation_order/03.evaluation_respects_parentheses_and_precedence/list.int_assoc.yaml diff --git a/migrator/test/staticTS/CTS/07.expressions/06.evaluation_order/03.evaluation_respects_parentheses_and_precedence/int_parens.sts b/migrator/test/staticTS/CTS/07.expressions/06.evaluation_order/03.evaluation_respects_parentheses_and_precedence/int_parens.sts new file mode 100644 index 000000000..d3a75f0b2 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/06.evaluation_order/03.evaluation_respects_parentheses_and_precedence/int_parens.sts @@ -0,0 +1,10 @@ +{% for ia in int_assoc %} +/*--- +desc: Integer addition and multiplication are associative +---*/ + +function main(): void { + assert {{.ia.left}} == {{.ia.right}}; +} + +{% endfor %} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/06.evaluation_order/03.evaluation_respects_parentheses_and_precedence/list.int_assoc.yaml b/migrator/test/staticTS/CTS/07.expressions/06.evaluation_order/03.evaluation_respects_parentheses_and_precedence/list.int_assoc.yaml new file mode 100644 index 000000000..f7928c81c --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/06.evaluation_order/03.evaluation_respects_parentheses_and_precedence/list.int_assoc.yaml @@ -0,0 +1,17 @@ +--- # List of integer addition and multiplication associative tests + +- {left: "2+3+4+5", right: "(2+3)+4+5"} +- {left: "2+3+4+5", right: "(2+3)+(4+5)"} +- {left: "2+3+4+5", right: "2+(3+4)+5"} +- {left: "2+3+4+5", right: "2+3+(4+5)"} +- {left: "2+3+4+5", right: "(((2+3)+4)+5)"} +- {left: "2+3+4+5", right: "((2+3)+4)+5"} + +- {left: "2*3*4*5", right: "(2*3)*4*5"} +- {left: "2*3*4*5", right: "(2*3)*(4*5)"} +- {left: "2*3*4*5", right: "2*(3*4)*5"} +- {left: "2*3*4*5", right: "2*3*(4*5)"} +- {left: "2*3*4*5", right: "(((2*3)*4)*5)"} +- {left: "2*3*4*5", right: "((2*3)*4)*5"} + + -- Gitee From 15ce09a1e68355b20dac821b16fb3a237b72943a Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Thu, 25 Aug 2022 15:59:22 +0300 Subject: [PATCH 42/84] Add argument order test (function) --- .../arg_order_function.sts | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 migrator/test/staticTS/CTS/07.expressions/06.evaluation_order/04.arguments_lists_are_evaluated_left-to-right/arg_order_function.sts diff --git a/migrator/test/staticTS/CTS/07.expressions/06.evaluation_order/04.arguments_lists_are_evaluated_left-to-right/arg_order_function.sts b/migrator/test/staticTS/CTS/07.expressions/06.evaluation_order/04.arguments_lists_are_evaluated_left-to-right/arg_order_function.sts new file mode 100644 index 000000000..94c014203 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/06.evaluation_order/04.arguments_lists_are_evaluated_left-to-right/arg_order_function.sts @@ -0,0 +1,47 @@ +/*--- +desc: Argument list evaluation order (functions) +---*/ + +let a: boolean = false; +let b: boolean = false; +let c: boolean = false; + +function ta(): int { + assert !a; + assert !b; + assert !c; + a = true; + return 0; +} + +function tb(): int { + assert a; + assert !b; + assert !c; + b = true; + return 1; +} + +function tc(): int { + assert a; + assert b; + assert !c; + c = true; + return 2; +} + +function td(): int { + assert a; + assert b; + assert c; + return 3; +} + + +function test(a: int, b: int, c: int, d: int): void { + assert a == 0 && b == 1 && c == 2 && d == 3; +} + +function main(): void { + test(ta(), tb(), tc(), td()); +} \ No newline at end of file -- Gitee From 8396337b771ef0d5daf04785604f68d65ae43624 Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Thu, 25 Aug 2022 16:40:26 +0300 Subject: [PATCH 43/84] Add panic statement test --- .../08.statements/08.panic_statement/n.panic_statement.sts | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 migrator/test/staticTS/CTS/08.statements/08.panic_statement/n.panic_statement.sts diff --git a/migrator/test/staticTS/CTS/08.statements/08.panic_statement/n.panic_statement.sts b/migrator/test/staticTS/CTS/08.statements/08.panic_statement/n.panic_statement.sts new file mode 100644 index 000000000..9e942ff65 --- /dev/null +++ b/migrator/test/staticTS/CTS/08.statements/08.panic_statement/n.panic_statement.sts @@ -0,0 +1,7 @@ +/*--- +desc: Panic statement +---*/ + +function main(): void { + panic "Stop"; +} \ No newline at end of file -- Gitee From b913f16876428706d7ac58c125c19c676f5c08dc Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Thu, 25 Aug 2022 16:43:12 +0300 Subject: [PATCH 44/84] Rename folder for panic --- .../n.panic_statement.sts | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename migrator/test/staticTS/CTS/08.statements/{08.panic_statement => 16.panic_statement}/n.panic_statement.sts (100%) diff --git a/migrator/test/staticTS/CTS/08.statements/08.panic_statement/n.panic_statement.sts b/migrator/test/staticTS/CTS/08.statements/16.panic_statement/n.panic_statement.sts similarity index 100% rename from migrator/test/staticTS/CTS/08.statements/08.panic_statement/n.panic_statement.sts rename to migrator/test/staticTS/CTS/08.statements/16.panic_statement/n.panic_statement.sts -- Gitee From f923b93b61e55764e8419baa7c6d8d2dbbd36396 Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Thu, 25 Aug 2022 16:46:50 +0300 Subject: [PATCH 45/84] Add interface field declaration test --- .../interface_field_decl.sts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 migrator/test/staticTS/CTS/10.interfaces/05.interface_field_declarations/interface_field_decl.sts diff --git a/migrator/test/staticTS/CTS/10.interfaces/05.interface_field_declarations/interface_field_decl.sts b/migrator/test/staticTS/CTS/10.interfaces/05.interface_field_declarations/interface_field_decl.sts new file mode 100644 index 000000000..87d5c9143 --- /dev/null +++ b/migrator/test/staticTS/CTS/10.interfaces/05.interface_field_declarations/interface_field_decl.sts @@ -0,0 +1,15 @@ +/*--- +desc: Interface field declaration +---*/ + +interface BaseColors { + RED: int = 1; + GREEN: int = 2; + BLUE: int = 3; +} + +interface ExtendedColors extends BaseColors { + YELLOW: int = 4; +} + +function main(): void {} \ No newline at end of file -- Gitee From de8036f7bf74f1cb74e357a4a9e2fbb0059a32f3 Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Thu, 25 Aug 2022 16:49:38 +0300 Subject: [PATCH 46/84] Add static interface methods test --- .../static_interface_methods.sts | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 migrator/test/staticTS/CTS/10.interfaces/06.interface_method_declaration/01.static_interface_methods/static_interface_methods.sts diff --git a/migrator/test/staticTS/CTS/10.interfaces/06.interface_method_declaration/01.static_interface_methods/static_interface_methods.sts b/migrator/test/staticTS/CTS/10.interfaces/06.interface_method_declaration/01.static_interface_methods/static_interface_methods.sts new file mode 100644 index 000000000..777d0f913 --- /dev/null +++ b/migrator/test/staticTS/CTS/10.interfaces/06.interface_method_declaration/01.static_interface_methods/static_interface_methods.sts @@ -0,0 +1,11 @@ +/*--- +desc: Static interface methods +---*/ + +interface Vehicle { + static getHorsePower(rpm: int, torque: int): int { + return (rpm * torque) / 5252; + } +} + +function main(): void {} -- Gitee From 633eb93a504df512ae978231e8fa561feb1e6aea Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Thu, 25 Aug 2022 16:51:08 +0300 Subject: [PATCH 47/84] Use underscore sign instead of dash --- .../arg_order_function.sts | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename migrator/test/staticTS/CTS/07.expressions/06.evaluation_order/{04.arguments_lists_are_evaluated_left-to-right => 04.arguments_lists_are_evaluated_left_to_right}/arg_order_function.sts (100%) diff --git a/migrator/test/staticTS/CTS/07.expressions/06.evaluation_order/04.arguments_lists_are_evaluated_left-to-right/arg_order_function.sts b/migrator/test/staticTS/CTS/07.expressions/06.evaluation_order/04.arguments_lists_are_evaluated_left_to_right/arg_order_function.sts similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/06.evaluation_order/04.arguments_lists_are_evaluated_left-to-right/arg_order_function.sts rename to migrator/test/staticTS/CTS/07.expressions/06.evaluation_order/04.arguments_lists_are_evaluated_left_to_right/arg_order_function.sts -- Gitee From a4e6437f67512bb9a192f8d4c05343c252948f28 Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Thu, 25 Aug 2022 16:56:42 +0300 Subject: [PATCH 48/84] Add static method without body --- .../n.static_interface_methods.sts | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 migrator/test/staticTS/CTS/10.interfaces/06.interface_method_declaration/01.static_interface_methods/n.static_interface_methods.sts diff --git a/migrator/test/staticTS/CTS/10.interfaces/06.interface_method_declaration/01.static_interface_methods/n.static_interface_methods.sts b/migrator/test/staticTS/CTS/10.interfaces/06.interface_method_declaration/01.static_interface_methods/n.static_interface_methods.sts new file mode 100644 index 000000000..dd6ed91e0 --- /dev/null +++ b/migrator/test/staticTS/CTS/10.interfaces/06.interface_method_declaration/01.static_interface_methods/n.static_interface_methods.sts @@ -0,0 +1,9 @@ +/*--- +desc: Static interface methods should have a body +---*/ + +interface Vehicle { + static getHorsePower(rpm: int, torque: int): int +} + +function main(): void {} -- Gitee From 7855b8a9a5723329e2bda6672dbff89b39074582 Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Thu, 25 Aug 2022 16:57:51 +0300 Subject: [PATCH 49/84] Add private static method --- .../private_interface_methods.sts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 migrator/test/staticTS/CTS/10.interfaces/06.interface_method_declaration/02.private_interface_methods/private_interface_methods.sts diff --git a/migrator/test/staticTS/CTS/10.interfaces/06.interface_method_declaration/02.private_interface_methods/private_interface_methods.sts b/migrator/test/staticTS/CTS/10.interfaces/06.interface_method_declaration/02.private_interface_methods/private_interface_methods.sts new file mode 100644 index 000000000..a7b52dbe4 --- /dev/null +++ b/migrator/test/staticTS/CTS/10.interfaces/06.interface_method_declaration/02.private_interface_methods/private_interface_methods.sts @@ -0,0 +1,14 @@ +/*--- +desc: Private interface methods +---*/ + +interface Vehicle { + private static getHorsePower(rpm: int, torque: int): int { + return (rpm * torque) / 5252; + } + private getHorsePower2(rpm: int, torque: int): int { + return (rpm * torque) / 5252; + } +} + +function main(): void {} \ No newline at end of file -- Gitee From a2bbda27a1aa39f5c082aeef48a36ff7c2c5b70e Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Thu, 25 Aug 2022 16:59:39 +0300 Subject: [PATCH 50/84] Add private static without body --- .../n.private_interface_methods.sts | 9 +++++++++ .../n.private_interface_methods_static.sts | 9 +++++++++ 2 files changed, 18 insertions(+) create mode 100644 migrator/test/staticTS/CTS/10.interfaces/06.interface_method_declaration/02.private_interface_methods/n.private_interface_methods.sts create mode 100644 migrator/test/staticTS/CTS/10.interfaces/06.interface_method_declaration/02.private_interface_methods/n.private_interface_methods_static.sts diff --git a/migrator/test/staticTS/CTS/10.interfaces/06.interface_method_declaration/02.private_interface_methods/n.private_interface_methods.sts b/migrator/test/staticTS/CTS/10.interfaces/06.interface_method_declaration/02.private_interface_methods/n.private_interface_methods.sts new file mode 100644 index 000000000..28c2fc94a --- /dev/null +++ b/migrator/test/staticTS/CTS/10.interfaces/06.interface_method_declaration/02.private_interface_methods/n.private_interface_methods.sts @@ -0,0 +1,9 @@ +/*--- +desc: Private interface methods +---*/ + +interface Vehicle { + private getHorsePower(rpm: int, torque: int): int +} + +function main(): void {} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/10.interfaces/06.interface_method_declaration/02.private_interface_methods/n.private_interface_methods_static.sts b/migrator/test/staticTS/CTS/10.interfaces/06.interface_method_declaration/02.private_interface_methods/n.private_interface_methods_static.sts new file mode 100644 index 000000000..bfe508da4 --- /dev/null +++ b/migrator/test/staticTS/CTS/10.interfaces/06.interface_method_declaration/02.private_interface_methods/n.private_interface_methods_static.sts @@ -0,0 +1,9 @@ +/*--- +desc: Private interface methods +---*/ + +interface Vehicle { + private static getHorsePower(rpm: int, torque: int): int +} + +function main(): void {} \ No newline at end of file -- Gitee From 10d62bc97f3e61c7a2e6ce30bd11ccbf6729dda0 Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Thu, 25 Aug 2022 17:04:52 +0300 Subject: [PATCH 51/84] Add enum methods --- .../enum_type_methods_valueof.sts | 11 +++++++++++ .../02.enum_type_methods/enum_type_methods_values.sts | 10 ++++++++++ 2 files changed, 21 insertions(+) create mode 100644 migrator/test/staticTS/CTS/11.enums/02.enum_type_methods/enum_type_methods_valueof.sts create mode 100644 migrator/test/staticTS/CTS/11.enums/02.enum_type_methods/enum_type_methods_values.sts diff --git a/migrator/test/staticTS/CTS/11.enums/02.enum_type_methods/enum_type_methods_valueof.sts b/migrator/test/staticTS/CTS/11.enums/02.enum_type_methods/enum_type_methods_valueof.sts new file mode 100644 index 000000000..70edec030 --- /dev/null +++ b/migrator/test/staticTS/CTS/11.enums/02.enum_type_methods/enum_type_methods_valueof.sts @@ -0,0 +1,11 @@ +/*--- +desc: Enum type methods (valueOf) +---*/ + +enum Colors {Red, Green, Blue} + +function main(): void { + let colors = Color.values(); + let red = Color.valueOf("Red"); + assert red == colors[0]; +} diff --git a/migrator/test/staticTS/CTS/11.enums/02.enum_type_methods/enum_type_methods_values.sts b/migrator/test/staticTS/CTS/11.enums/02.enum_type_methods/enum_type_methods_values.sts new file mode 100644 index 000000000..fb75f11e7 --- /dev/null +++ b/migrator/test/staticTS/CTS/11.enums/02.enum_type_methods/enum_type_methods_values.sts @@ -0,0 +1,10 @@ +/*--- +desc: Enum type methods (values) +---*/ + +enum Colors {Red, Green, Blue} + +function main(): void { + let colors = Color.values(); + assert colors != []; +} -- Gitee From c3b01d13daba08cbb98cf14167fcaa26caaaed5e Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Fri, 26 Aug 2022 12:18:42 +0300 Subject: [PATCH 52/84] Add generic equality rules --- .../24.equality_operator/general_equality_00.sts | 14 ++++++++++++++ .../24.equality_operator/general_equality_01.sts | 11 +++++++++++ .../24.equality_operator/general_equality_02.sts | 13 +++++++++++++ 3 files changed, 38 insertions(+) create mode 100644 migrator/test/staticTS/CTS/07.expressions/24.equality_operator/general_equality_00.sts create mode 100644 migrator/test/staticTS/CTS/07.expressions/24.equality_operator/general_equality_01.sts create mode 100644 migrator/test/staticTS/CTS/07.expressions/24.equality_operator/general_equality_02.sts diff --git a/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/general_equality_00.sts b/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/general_equality_00.sts new file mode 100644 index 000000000..8cfaf2d30 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/general_equality_00.sts @@ -0,0 +1,14 @@ +/*--- +desc: Equality operators, common rules +---*/ + +function main(): void { + let a = 0; + let b = 0; + let c = 1; + + let cmp1 = a == b != c; + let cmp2 = (a == b) != c; + + assert cmp1 == cmp2; +} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/general_equality_01.sts b/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/general_equality_01.sts new file mode 100644 index 000000000..491b19eb2 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/general_equality_01.sts @@ -0,0 +1,11 @@ +/*--- +desc: Equality operators, common rules +---*/ + +function main(): void { + let a = 0; + let b = 0; + let c = 1; + + assert a < c == b < c; +} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/general_equality_02.sts b/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/general_equality_02.sts new file mode 100644 index 000000000..b7dbe1872 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/general_equality_02.sts @@ -0,0 +1,13 @@ +/*--- +desc: Equality operators, common rules +---*/ + +function main(): void { + let a = 0; + let b = 1; + + let cmp1 = a != b; + let cmp2 = !(a == b); + + assert cmp1 == cmp2; +} \ No newline at end of file -- Gitee From 415de9e800db7616669ee4990aca9b2c8d4fecc6 Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Fri, 26 Aug 2022 12:26:36 +0300 Subject: [PATCH 53/84] Add floating equality tests --- .../float_equality_00.sts | 13 +++++++++++++ .../float_equality_01.sts | 9 +++++++++ .../float_equality_02.sts | 11 +++++++++++ .../float_equality_03.sts | 12 ++++++++++++ .../float_equality_04.sts | 13 +++++++++++++ 5 files changed, 58 insertions(+) create mode 100644 migrator/test/staticTS/CTS/07.expressions/24.equality_operator/01.numerical_equality_operators/float_equality_00.sts create mode 100644 migrator/test/staticTS/CTS/07.expressions/24.equality_operator/01.numerical_equality_operators/float_equality_01.sts create mode 100644 migrator/test/staticTS/CTS/07.expressions/24.equality_operator/01.numerical_equality_operators/float_equality_02.sts create mode 100644 migrator/test/staticTS/CTS/07.expressions/24.equality_operator/01.numerical_equality_operators/float_equality_03.sts create mode 100644 migrator/test/staticTS/CTS/07.expressions/24.equality_operator/01.numerical_equality_operators/float_equality_04.sts diff --git a/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/01.numerical_equality_operators/float_equality_00.sts b/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/01.numerical_equality_operators/float_equality_00.sts new file mode 100644 index 000000000..03fac4cd4 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/01.numerical_equality_operators/float_equality_00.sts @@ -0,0 +1,13 @@ +/*--- +desc: Floating number equality +corner-case: true +---*/ + +function main(): void { + let a = 0.1; + assert a != NaN; + assert NaN != a; + + assert !(a == NaN); + assert !(NaN == a); +} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/01.numerical_equality_operators/float_equality_01.sts b/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/01.numerical_equality_operators/float_equality_01.sts new file mode 100644 index 000000000..5c0a6a84a --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/01.numerical_equality_operators/float_equality_01.sts @@ -0,0 +1,9 @@ +/*--- +desc: Floating number equality +corner-case: true +---*/ + +function main(): void { + let a = NaN; + assert a != a; +} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/01.numerical_equality_operators/float_equality_02.sts b/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/01.numerical_equality_operators/float_equality_02.sts new file mode 100644 index 000000000..03db42676 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/01.numerical_equality_operators/float_equality_02.sts @@ -0,0 +1,11 @@ +/*--- +desc: Floating number equality +corner-case: true +---*/ + +function main(): void { + let a = +0.0; + let b = -0.0; + + assert a == b; +} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/01.numerical_equality_operators/float_equality_03.sts b/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/01.numerical_equality_operators/float_equality_03.sts new file mode 100644 index 000000000..68f66bf0d --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/01.numerical_equality_operators/float_equality_03.sts @@ -0,0 +1,12 @@ +/*--- +desc: Floating number equality +corner-case: true +---*/ + +function main(): void { + let a = 0.1; + let b = 0.0; + + assert a != b; + assert b != a; +} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/01.numerical_equality_operators/float_equality_04.sts b/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/01.numerical_equality_operators/float_equality_04.sts new file mode 100644 index 000000000..5e4ece226 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/01.numerical_equality_operators/float_equality_04.sts @@ -0,0 +1,13 @@ +/*--- +desc: Floating number equality +corner-case: true +---*/ + +function main(): void { + let a = 0.1; + assert a != INF; + assert INF != a; + assert a != -INF; + assert -INF != a; + +} \ No newline at end of file -- Gitee From 602085245f287bd7ad2c06874bd2e6fc72d4f26e Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Fri, 26 Aug 2022 12:33:35 +0300 Subject: [PATCH 54/84] Add boolean equality tests --- .../02.boolean_equality_operators/boolean_eq.sts | 11 +++++++++++ .../list.boolean_eq.yaml | 11 +++++++++++ 2 files changed, 22 insertions(+) create mode 100644 migrator/test/staticTS/CTS/07.expressions/24.equality_operator/02.boolean_equality_operators/boolean_eq.sts create mode 100644 migrator/test/staticTS/CTS/07.expressions/24.equality_operator/02.boolean_equality_operators/list.boolean_eq.yaml diff --git a/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/02.boolean_equality_operators/boolean_eq.sts b/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/02.boolean_equality_operators/boolean_eq.sts new file mode 100644 index 000000000..3a4c00122 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/02.boolean_equality_operators/boolean_eq.sts @@ -0,0 +1,11 @@ +{% for eq in boolean_eq %} +/*--- +desc: Boolean equality +params: {{.eq.left}} {{.eq.op}} {{.eq.right}} is {{.eq.result}} +---*/ + +function main(): void { + assert ({{.eq.left}} {{.eq.op}} {{.eq.right}}) == {{.eq.result}}; +} + +{% endfor %} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/02.boolean_equality_operators/list.boolean_eq.yaml b/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/02.boolean_equality_operators/list.boolean_eq.yaml new file mode 100644 index 000000000..d2d4887cf --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/02.boolean_equality_operators/list.boolean_eq.yaml @@ -0,0 +1,11 @@ +--- # List of boolean equality operators + +- {left: "true", right: "true", op: "==", result: "true"} +- {left: "true", right: "false", op: "==", result: "false"} +- {left: "false", right: "true", op: "==", result: "false"} +- {left: "false", right: "false", op: "==", result: "true"} + +- {left: "true", right: "true", op: "!=", result: "false"} +- {left: "true", right: "false", op: "!=", result: "true"} +- {left: "false", right: "true", op: "!=", result: "true"} +- {left: "false", right: "false", op: "!=", result: "false"} -- Gitee From eb6f7f297fa58dfb32d09ae1376f2299e036e8b2 Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Fri, 26 Aug 2022 12:58:18 +0300 Subject: [PATCH 55/84] Add string equality tests --- .../list.string_eq.yaml | 18 ++++++++++++++++++ .../03.string_equality_operators/string_eq.sts | 14 ++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 migrator/test/staticTS/CTS/07.expressions/24.equality_operator/03.string_equality_operators/list.string_eq.yaml create mode 100644 migrator/test/staticTS/CTS/07.expressions/24.equality_operator/03.string_equality_operators/string_eq.sts diff --git a/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/03.string_equality_operators/list.string_eq.yaml b/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/03.string_equality_operators/list.string_eq.yaml new file mode 100644 index 000000000..25b0e6ab0 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/03.string_equality_operators/list.string_eq.yaml @@ -0,0 +1,18 @@ +--- # List of boolean equality operators + +- {left: "\"a\"", right: "\"a\"", op: "==", result: "true"} +- {left: "\"aa\"", right: "\"aa\"", op: "==", result: "true"} +- {left: "\"aaa\"", right: "\"aaa\"", op: "==", result: "true"} + +- {left: "\"a\"", right: "\"b\"", op: "==", result: "false"} +- {left: "\"aa\"", right: "\"ba\"", op: "==", result: "false"} +- {left: "\"aaa\"", right: "\"aba\"", op: "==", result: "false"} + +- {left: "\"a\"", right: "\"a\"", op: "!=", result: "false"} +- {left: "\"aa\"", right: "\"aa\"", op: "!=", result: "false"} +- {left: "\"aaa\"", right: "\"aaa\"", op: "!=", result: "false"} + +- {left: "\"a\"", right: "\"b\"", op: "!=", result: "true"} +- {left: "\"aa\"", right: "\"ba\"", op: "!=", result: "true"} +- {left: "\"aaa\"", right: "\"aba\"", op: "!=", result: "true"} + diff --git a/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/03.string_equality_operators/string_eq.sts b/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/03.string_equality_operators/string_eq.sts new file mode 100644 index 000000000..d7abd70fa --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/03.string_equality_operators/string_eq.sts @@ -0,0 +1,14 @@ +{% for eq in string_eq %} +/*--- +desc: String equality +params: | + {{.eq.left}} {{.eq.op}} {{.eq.right}} is {{.eq.result}} +---*/ + +function main(): void { + let a: String = {{.eq.left}}; + let b: String = {{.eq.right}}; + assert (a {{.eq.op}} b) == {{.eq.result}}; +} + +{% endfor %} \ No newline at end of file -- Gitee From dfbc5e9e1378a5b8e29de89aa6446e5d36d9d12c Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Wed, 31 Aug 2022 13:44:00 +0300 Subject: [PATCH 56/84] Add package level scope --- .../03.scopes/package_level.sts | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 migrator/test/staticTS/CTS/04.names_declarations_and_scopes/03.scopes/package_level.sts diff --git a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/03.scopes/package_level.sts b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/03.scopes/package_level.sts new file mode 100644 index 000000000..ec8fd7b56 --- /dev/null +++ b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/03.scopes/package_level.sts @@ -0,0 +1,21 @@ +/*--- +desc: Package level scope +---*/ +package scopes; + +let x = 1; + +class C { + y: int = x + 1; +} + +interface I { + // TODO: Is that correct? + z: int = x * 2; +} + +function foo(): int { + return x - 1; +} + +function main(): void {} \ No newline at end of file -- Gitee From fb21da8b2b996d5da36a67195f6d4da11c768bc5 Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Wed, 31 Aug 2022 13:46:07 +0300 Subject: [PATCH 57/84] Add class level scope --- .../03.scopes/class_level.sts | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 migrator/test/staticTS/CTS/04.names_declarations_and_scopes/03.scopes/class_level.sts diff --git a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/03.scopes/class_level.sts b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/03.scopes/class_level.sts new file mode 100644 index 000000000..86e96e91e --- /dev/null +++ b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/03.scopes/class_level.sts @@ -0,0 +1,13 @@ +/*--- +desc: Class level scope +---*/ +package scopes; + +class C { + x: int = 1; + foo(): int { + return this.x; + } +} + +function main(): void {} \ No newline at end of file -- Gitee From 78f0cd891935c0b1cafa42f9c1c997a20d294d28 Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Wed, 31 Aug 2022 13:48:12 +0300 Subject: [PATCH 58/84] Add hoisting test --- .../03.scopes/n.hoisting.sts | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 migrator/test/staticTS/CTS/04.names_declarations_and_scopes/03.scopes/n.hoisting.sts diff --git a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/03.scopes/n.hoisting.sts b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/03.scopes/n.hoisting.sts new file mode 100644 index 000000000..c9c26a829 --- /dev/null +++ b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/03.scopes/n.hoisting.sts @@ -0,0 +1,9 @@ +/*--- +desc: Hoisting not available +---*/ +package scopes; + +function main(): void { + let x = y; + let y = 1; +} \ No newline at end of file -- Gitee From 90352b7de056c3448ed30b82eebb3df40b06ef88 Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Wed, 31 Aug 2022 13:49:13 +0300 Subject: [PATCH 59/84] Add enum level scope --- .../03.scopes/tbd.enum_level.sts | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 migrator/test/staticTS/CTS/04.names_declarations_and_scopes/03.scopes/tbd.enum_level.sts diff --git a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/03.scopes/tbd.enum_level.sts b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/03.scopes/tbd.enum_level.sts new file mode 100644 index 000000000..43d44a378 --- /dev/null +++ b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/03.scopes/tbd.enum_level.sts @@ -0,0 +1,10 @@ +/*--- +desc: Enum level scope +---*/ +package scopes; + +interface I { + x: int = 1; +} + +function main(): void {} \ No newline at end of file -- Gitee From 11402523973198cb0aba468ef17d8f8cbe21b588 Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Thu, 8 Sep 2022 13:51:30 +0300 Subject: [PATCH 60/84] Add shift operators --- .../list.right_shift_negative.yaml | 4 ++++ .../21.shift_operators/list.shift_errors.yaml | 7 +++++++ .../21.shift_operators/n.shift_int.sts | 11 +++++++++++ .../21.shift_operators/rshift_int.sts | 15 +++++++++++++++ 4 files changed, 37 insertions(+) create mode 100644 migrator/test/staticTS/CTS/07.expressions/21.shift_operators/list.right_shift_negative.yaml create mode 100644 migrator/test/staticTS/CTS/07.expressions/21.shift_operators/list.shift_errors.yaml create mode 100644 migrator/test/staticTS/CTS/07.expressions/21.shift_operators/n.shift_int.sts create mode 100644 migrator/test/staticTS/CTS/07.expressions/21.shift_operators/rshift_int.sts diff --git a/migrator/test/staticTS/CTS/07.expressions/21.shift_operators/list.right_shift_negative.yaml b/migrator/test/staticTS/CTS/07.expressions/21.shift_operators/list.right_shift_negative.yaml new file mode 100644 index 000000000..3954a9266 --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/21.shift_operators/list.right_shift_negative.yaml @@ -0,0 +1,4 @@ +--- # List of shift operators and numeric errors + +- {type: int, value: "0x80000000"} +- {type: long, value: "-1"} diff --git a/migrator/test/staticTS/CTS/07.expressions/21.shift_operators/list.shift_errors.yaml b/migrator/test/staticTS/CTS/07.expressions/21.shift_operators/list.shift_errors.yaml new file mode 100644 index 000000000..e03a95d9c --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/21.shift_operators/list.shift_errors.yaml @@ -0,0 +1,7 @@ +--- # List of shift operators and numeric errors + +- {type: int, shift: "<<", value: "0x20"} +- {type: int, shift: ">>", value: "0x20"} + +- {type: long, shift: "<<", value: "0x40"} +- {type: long, shift: ">>", value: "0x40"} diff --git a/migrator/test/staticTS/CTS/07.expressions/21.shift_operators/n.shift_int.sts b/migrator/test/staticTS/CTS/07.expressions/21.shift_operators/n.shift_int.sts new file mode 100644 index 000000000..c9996541d --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/21.shift_operators/n.shift_int.sts @@ -0,0 +1,11 @@ +{% for se in shift_errors %} +/*--- +desc: Shift of int type, large shift value +---*/ + +function main(): void { + let v: {{.se.type}} = 1; + let k = v {{.se.shift}} {{.se.value}}; +} + +{% endfor %} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/07.expressions/21.shift_operators/rshift_int.sts b/migrator/test/staticTS/CTS/07.expressions/21.shift_operators/rshift_int.sts new file mode 100644 index 000000000..4d06a7f2d --- /dev/null +++ b/migrator/test/staticTS/CTS/07.expressions/21.shift_operators/rshift_int.sts @@ -0,0 +1,15 @@ +{% for rn in right_shift_negative %} +/*--- +desc: Corner case for right shift +corner-case: true +---*/ + +function main(): void { + let n: {{.rn.type}} = {{.rn.value}}; + let s = 1; + + let a = n >>> s; + let b = (n >> s) + (2 << ~s); + assert a == b; +} +{% endfor %} \ No newline at end of file -- Gitee From 66974c5cc4eec252ea3bf8367ccc9878fe63b465 Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Thu, 8 Sep 2022 15:35:16 +0300 Subject: [PATCH 61/84] Fix capitalization issue --- .../list.default_value.yaml | 2 +- .../01.interface_declarations/list.default_value.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/06.default_values_for_primitive_types/list.default_value.yaml b/migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/06.default_values_for_primitive_types/list.default_value.yaml index 9ffc292f9..7b2339b3d 100644 --- a/migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/06.default_values_for_primitive_types/list.default_value.yaml +++ b/migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/06.default_values_for_primitive_types/list.default_value.yaml @@ -7,4 +7,4 @@ - {type: float, value: 0.0} - {type: double, value: 0.0} - {type: char, value: '\u0000'} -- {type: boolean, value: false} +- {type: boolean, value: "false"} diff --git a/migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/list.default_value.yaml b/migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/list.default_value.yaml index 9ffc292f9..7b2339b3d 100644 --- a/migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/list.default_value.yaml +++ b/migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/list.default_value.yaml @@ -7,4 +7,4 @@ - {type: float, value: 0.0} - {type: double, value: 0.0} - {type: char, value: '\u0000'} -- {type: boolean, value: false} +- {type: boolean, value: "false"} -- Gitee From 00db9b4d0f6dd83d0b797b84bd5ff47c96bac2ec Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Thu, 8 Sep 2022 15:51:33 +0300 Subject: [PATCH 62/84] Add if statement --- .../staticTS/CTS/08.statements/05.if_statement/if.sts | 11 +++++++++++ .../08.statements/05.if_statement/if_not_executed.sts | 9 +++++++++ .../CTS/08.statements/05.if_statement/nested_if.sts | 11 +++++++++++ 3 files changed, 31 insertions(+) create mode 100644 migrator/test/staticTS/CTS/08.statements/05.if_statement/if.sts create mode 100644 migrator/test/staticTS/CTS/08.statements/05.if_statement/if_not_executed.sts create mode 100644 migrator/test/staticTS/CTS/08.statements/05.if_statement/nested_if.sts diff --git a/migrator/test/staticTS/CTS/08.statements/05.if_statement/if.sts b/migrator/test/staticTS/CTS/08.statements/05.if_statement/if.sts new file mode 100644 index 000000000..5b7b8eea2 --- /dev/null +++ b/migrator/test/staticTS/CTS/08.statements/05.if_statement/if.sts @@ -0,0 +1,11 @@ +/*--- +desc: If statement +---*/ + +function main(): void { + let i = 1; + if (i > 0) { + i--; + } + assert i == 0; +} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/08.statements/05.if_statement/if_not_executed.sts b/migrator/test/staticTS/CTS/08.statements/05.if_statement/if_not_executed.sts new file mode 100644 index 000000000..436fdc406 --- /dev/null +++ b/migrator/test/staticTS/CTS/08.statements/05.if_statement/if_not_executed.sts @@ -0,0 +1,9 @@ +/*--- +desc: If statement (not executed) +---*/ + +function main(): void { + if (false) { + assert false; + } +} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/08.statements/05.if_statement/nested_if.sts b/migrator/test/staticTS/CTS/08.statements/05.if_statement/nested_if.sts new file mode 100644 index 000000000..a187f68d0 --- /dev/null +++ b/migrator/test/staticTS/CTS/08.statements/05.if_statement/nested_if.sts @@ -0,0 +1,11 @@ +/*--- +desc: Nested if statement +---*/ + +function main(): void { + if (false) { + if (true) { + assert false; + } + } else assert true; +} \ No newline at end of file -- Gitee From 252471f36c38923a964a5542d5f4302f00b44ab2 Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Thu, 8 Sep 2022 15:59:22 +0300 Subject: [PATCH 63/84] Add for loop --- .../08.statements/07.for_statement/for_existing.sts | 12 ++++++++++++ .../CTS/08.statements/07.for_statement/for_new.sts | 11 +++++++++++ .../07.for_statement/for_new_implicit.sts | 11 +++++++++++ 3 files changed, 34 insertions(+) create mode 100644 migrator/test/staticTS/CTS/08.statements/07.for_statement/for_existing.sts create mode 100644 migrator/test/staticTS/CTS/08.statements/07.for_statement/for_new.sts create mode 100644 migrator/test/staticTS/CTS/08.statements/07.for_statement/for_new_implicit.sts diff --git a/migrator/test/staticTS/CTS/08.statements/07.for_statement/for_existing.sts b/migrator/test/staticTS/CTS/08.statements/07.for_statement/for_existing.sts new file mode 100644 index 000000000..e1276ec8d --- /dev/null +++ b/migrator/test/staticTS/CTS/08.statements/07.for_statement/for_existing.sts @@ -0,0 +1,12 @@ +/*--- +desc: For loop with existing variable +---*/ + +function main(): void { + let i = 0; + let sum = 0; + for (i = 1; i < 4; i++) { + sum += i; + } + assert sum == 6; +} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/08.statements/07.for_statement/for_new.sts b/migrator/test/staticTS/CTS/08.statements/07.for_statement/for_new.sts new file mode 100644 index 000000000..38937439a --- /dev/null +++ b/migrator/test/staticTS/CTS/08.statements/07.for_statement/for_new.sts @@ -0,0 +1,11 @@ +/*--- +desc: For loop with new variable +---*/ + +function main(): void { + let sum = 0; + for (let i: int = 1; i < 4; i++) { + sum += i; + } + assert sum == 6; +} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/08.statements/07.for_statement/for_new_implicit.sts b/migrator/test/staticTS/CTS/08.statements/07.for_statement/for_new_implicit.sts new file mode 100644 index 000000000..cec77c012 --- /dev/null +++ b/migrator/test/staticTS/CTS/08.statements/07.for_statement/for_new_implicit.sts @@ -0,0 +1,11 @@ +/*--- +desc: For loop with new variable (implicit type) +---*/ + +function main(): void { + let sum = 0; + for (let i = 1; i < 4; i++) { + sum += i; + } + assert sum == 6; +} \ No newline at end of file -- Gitee From 20cde7a7450c049a5a9519814a9dcf8423f306e1 Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Thu, 8 Sep 2022 16:58:34 +0300 Subject: [PATCH 64/84] Add for of loop: --- .../08.statements/08.for_of_statement/for_of_new.sts | 12 ++++++++++++ .../08.for_of_statement/for_of_new_type.sts | 12 ++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 migrator/test/staticTS/CTS/08.statements/08.for_of_statement/for_of_new.sts create mode 100644 migrator/test/staticTS/CTS/08.statements/08.for_of_statement/for_of_new_type.sts diff --git a/migrator/test/staticTS/CTS/08.statements/08.for_of_statement/for_of_new.sts b/migrator/test/staticTS/CTS/08.statements/08.for_of_statement/for_of_new.sts new file mode 100644 index 000000000..b7958305c --- /dev/null +++ b/migrator/test/staticTS/CTS/08.statements/08.for_of_statement/for_of_new.sts @@ -0,0 +1,12 @@ +/*--- +desc: For of loop with new variable +---*/ + +function main(): void { + let sum = 0; + let arr: int[] = [1,2,3]; + for (let i of arr) { + sum += i; + } + assert sum == 6; +} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/08.statements/08.for_of_statement/for_of_new_type.sts b/migrator/test/staticTS/CTS/08.statements/08.for_of_statement/for_of_new_type.sts new file mode 100644 index 000000000..5e7291886 --- /dev/null +++ b/migrator/test/staticTS/CTS/08.statements/08.for_of_statement/for_of_new_type.sts @@ -0,0 +1,12 @@ +/*--- +desc: For of loop with new typed variable +---*/ + +function main(): void { + let sum = 0; + let arr: int[] = [1,2,3]; + for (let i: int of arr) { + sum += i; + } + assert sum == 6; +} \ No newline at end of file -- Gitee From d7a5ac81f7eee20bfbbfc327afcce2c6234b8e5e Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Thu, 8 Sep 2022 17:09:55 +0300 Subject: [PATCH 65/84] Add switch statement --- .../n.switch_duplicate.sts | 18 ++++++++++++++++++ .../12.switch_statement/switch.sts | 18 ++++++++++++++++++ .../12.switch_statement/switch_block.sts | 18 ++++++++++++++++++ .../12.switch_statement/switch_char.sts | 18 ++++++++++++++++++ .../12.switch_statement/switch_enum.sts | 19 +++++++++++++++++++ 5 files changed, 91 insertions(+) create mode 100644 migrator/test/staticTS/CTS/08.statements/12.switch_statement/n.switch_duplicate.sts create mode 100644 migrator/test/staticTS/CTS/08.statements/12.switch_statement/switch.sts create mode 100644 migrator/test/staticTS/CTS/08.statements/12.switch_statement/switch_block.sts create mode 100644 migrator/test/staticTS/CTS/08.statements/12.switch_statement/switch_char.sts create mode 100644 migrator/test/staticTS/CTS/08.statements/12.switch_statement/switch_enum.sts diff --git a/migrator/test/staticTS/CTS/08.statements/12.switch_statement/n.switch_duplicate.sts b/migrator/test/staticTS/CTS/08.statements/12.switch_statement/n.switch_duplicate.sts new file mode 100644 index 000000000..6e79f0920 --- /dev/null +++ b/migrator/test/staticTS/CTS/08.statements/12.switch_statement/n.switch_duplicate.sts @@ -0,0 +1,18 @@ +/*--- +desc: Switch statement, duplicate value +---*/ + +function f(i: int): void { + switch (i) { + case 0: assert i == 0; break; + case 0: assert i == 1; break; + case 0: assert i == 2; break; + default: assert false; + } +} + +function main(): void { + f(0); + f(1); + f(2); +} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/08.statements/12.switch_statement/switch.sts b/migrator/test/staticTS/CTS/08.statements/12.switch_statement/switch.sts new file mode 100644 index 000000000..7126274d5 --- /dev/null +++ b/migrator/test/staticTS/CTS/08.statements/12.switch_statement/switch.sts @@ -0,0 +1,18 @@ +/*--- +desc: Switch statement +---*/ + +function f(i: int): void { + switch (i) { + case 0: assert i == 0; break; + case 1: assert i == 1; break; + case 2: assert i == 2; break; + default: assert false; + } +} + +function main(): void { + f(0); + f(1); + f(2); +} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/08.statements/12.switch_statement/switch_block.sts b/migrator/test/staticTS/CTS/08.statements/12.switch_statement/switch_block.sts new file mode 100644 index 000000000..74aab7972 --- /dev/null +++ b/migrator/test/staticTS/CTS/08.statements/12.switch_statement/switch_block.sts @@ -0,0 +1,18 @@ +/*--- +desc: Switch statement with block +---*/ + +function f(i: int): void { + switch (i) { + case 0: { assert i == 0; } + case 1: { assert i == 1; } + case 2: { assert i == 2; } + default: { assert false; } + } +} + +function main(): void { + f(0); + f(1); + f(2); +} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/08.statements/12.switch_statement/switch_char.sts b/migrator/test/staticTS/CTS/08.statements/12.switch_statement/switch_char.sts new file mode 100644 index 000000000..d4b484af4 --- /dev/null +++ b/migrator/test/staticTS/CTS/08.statements/12.switch_statement/switch_char.sts @@ -0,0 +1,18 @@ +/*--- +desc: Switch statement with char +---*/ + +function f(i: char): void { + switch (i) { + case '0': { assert i == '0'; } + case '1': { assert i == '1'; } + case '2': { assert i == '2'; } + default: { assert false; } + } +} + +function main(): void { + f('0'); + f('1'); + f('2'); +} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/08.statements/12.switch_statement/switch_enum.sts b/migrator/test/staticTS/CTS/08.statements/12.switch_statement/switch_enum.sts new file mode 100644 index 000000000..d980c4fe4 --- /dev/null +++ b/migrator/test/staticTS/CTS/08.statements/12.switch_statement/switch_enum.sts @@ -0,0 +1,19 @@ +/*--- +desc: Switch statement with enum +---*/ + +enum Color { Red, Yellow, Green } + +function f(i: Color): void { + switch (i) { + case Red: assert i == Color.Red; break; + case Yellow: assert i == Color.Yellow; break; + case Green: assert i == Color.Green; break; + } +} + +function main(): void { + f(Color.Red); + f(Color.Yellow); + f(Color.Green); +} \ No newline at end of file -- Gitee From 6c951ddb8ddf7d6d37e355545d3d79688add720f Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Thu, 8 Sep 2022 17:16:19 +0300 Subject: [PATCH 66/84] Add class declaration --- .../CTS/09.classes/01.class_declaration/point.sts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 migrator/test/staticTS/CTS/09.classes/01.class_declaration/point.sts diff --git a/migrator/test/staticTS/CTS/09.classes/01.class_declaration/point.sts b/migrator/test/staticTS/CTS/09.classes/01.class_declaration/point.sts new file mode 100644 index 000000000..51bea8e6c --- /dev/null +++ b/migrator/test/staticTS/CTS/09.classes/01.class_declaration/point.sts @@ -0,0 +1,14 @@ +/*--- +desc: Point class from documentation +---*/ + +import std.math; + +class Point { + public x: double; + public y: double; + public length(): double { + return math.sqrt(this.x * this.x + this.y * this.y); + } + static origin = new Point(0, 0); +} \ No newline at end of file -- Gitee From 6f9e76871c9680848249fdb22d345ce50970276f Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Thu, 8 Sep 2022 17:29:15 +0300 Subject: [PATCH 67/84] Add abstract classes --- .../01.class_modifiers/01.abstract_classes/abstract.sts | 7 +++++++ .../01.abstract_classes/abstract_method.sts | 9 +++++++++ .../01.abstract_classes/n.abstract_instantiate.sts | 9 +++++++++ .../01.abstract_classes/n.abstract_method.sts | 9 +++++++++ .../01.abstract_classes/n.abstract_open.sts | 8 ++++++++ 5 files changed, 42 insertions(+) create mode 100644 migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/01.abstract_classes/abstract.sts create mode 100644 migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/01.abstract_classes/abstract_method.sts create mode 100644 migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/01.abstract_classes/n.abstract_instantiate.sts create mode 100644 migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/01.abstract_classes/n.abstract_method.sts create mode 100644 migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/01.abstract_classes/n.abstract_open.sts diff --git a/migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/01.abstract_classes/abstract.sts b/migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/01.abstract_classes/abstract.sts new file mode 100644 index 000000000..87c6a7626 --- /dev/null +++ b/migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/01.abstract_classes/abstract.sts @@ -0,0 +1,7 @@ +/*--- +desc: Abstract class +---*/ + +abstract class A {} + +function main(): void {} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/01.abstract_classes/abstract_method.sts b/migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/01.abstract_classes/abstract_method.sts new file mode 100644 index 000000000..08454c20b --- /dev/null +++ b/migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/01.abstract_classes/abstract_method.sts @@ -0,0 +1,9 @@ +/*--- +desc: Abstract class with abstract method +---*/ + +abstract class A { + abstract m(): void; +} + +function main(): void {} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/01.abstract_classes/n.abstract_instantiate.sts b/migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/01.abstract_classes/n.abstract_instantiate.sts new file mode 100644 index 000000000..8611e925d --- /dev/null +++ b/migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/01.abstract_classes/n.abstract_instantiate.sts @@ -0,0 +1,9 @@ +/*--- +desc: Abstract class instantiation +---*/ + +abstract class A {} + +function main(): void { + let a = new A(); +} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/01.abstract_classes/n.abstract_method.sts b/migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/01.abstract_classes/n.abstract_method.sts new file mode 100644 index 000000000..46e5bf3b0 --- /dev/null +++ b/migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/01.abstract_classes/n.abstract_method.sts @@ -0,0 +1,9 @@ +/*--- +desc: Non-abstract class with abstract method +---*/ + +class A { + abstract m(): void; +} + +function main(): void {} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/01.abstract_classes/n.abstract_open.sts b/migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/01.abstract_classes/n.abstract_open.sts new file mode 100644 index 000000000..331aab3c4 --- /dev/null +++ b/migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/01.abstract_classes/n.abstract_open.sts @@ -0,0 +1,8 @@ +/*--- +desc: Class can't be both abstract and open +---*/ + +abstract open class A {} +open abstract class B {} + +function main(): void {} \ No newline at end of file -- Gitee From ed34d98029d0ba65cee29eb5f8da95afe9b84031 Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Thu, 8 Sep 2022 17:32:02 +0300 Subject: [PATCH 68/84] Add open classes --- .../01.class_modifiers/02.open_classes/n.open_class.sts | 9 +++++++++ .../01.class_modifiers/02.open_classes/open_class.sts | 9 +++++++++ 2 files changed, 18 insertions(+) create mode 100644 migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/02.open_classes/n.open_class.sts create mode 100644 migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/02.open_classes/open_class.sts diff --git a/migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/02.open_classes/n.open_class.sts b/migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/02.open_classes/n.open_class.sts new file mode 100644 index 000000000..f9d6784f3 --- /dev/null +++ b/migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/02.open_classes/n.open_class.sts @@ -0,0 +1,9 @@ +/*--- +desc: Open class can be subclassed +---*/ + +class A{} + +class B extends A{} + +function main(): void {} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/02.open_classes/open_class.sts b/migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/02.open_classes/open_class.sts new file mode 100644 index 000000000..a361a56d9 --- /dev/null +++ b/migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/02.open_classes/open_class.sts @@ -0,0 +1,9 @@ +/*--- +desc: Open class can be subclassed +---*/ + +open class A{} + +class B extends A{} + +function main(): void {} \ No newline at end of file -- Gitee From 266c1f61456b3afaba28473801dafb2ae7ec6e82 Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Thu, 8 Sep 2022 17:40:08 +0300 Subject: [PATCH 69/84] Add class body --- .../04.class_body/class_members.sts | 11 +++++++++++ .../04.class_body/list.class_members.yaml | 7 +++++++ .../04.class_body/n.class_members.sts | 12 ++++++++++++ 3 files changed, 30 insertions(+) create mode 100644 migrator/test/staticTS/CTS/09.classes/01.class_declaration/04.class_body/class_members.sts create mode 100644 migrator/test/staticTS/CTS/09.classes/01.class_declaration/04.class_body/list.class_members.yaml create mode 100644 migrator/test/staticTS/CTS/09.classes/01.class_declaration/04.class_body/n.class_members.sts diff --git a/migrator/test/staticTS/CTS/09.classes/01.class_declaration/04.class_body/class_members.sts b/migrator/test/staticTS/CTS/09.classes/01.class_declaration/04.class_body/class_members.sts new file mode 100644 index 000000000..4b8d4f4b3 --- /dev/null +++ b/migrator/test/staticTS/CTS/09.classes/01.class_declaration/04.class_body/class_members.sts @@ -0,0 +1,11 @@ +{% for cm in class_members %} +/*--- +desc: Class members +---*/ + +class A { + {{.cm}} +} + +function main(): void {} +{% endfor %} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/09.classes/01.class_declaration/04.class_body/list.class_members.yaml b/migrator/test/staticTS/CTS/09.classes/01.class_declaration/04.class_body/list.class_members.yaml new file mode 100644 index 000000000..69974389b --- /dev/null +++ b/migrator/test/staticTS/CTS/09.classes/01.class_declaration/04.class_body/list.class_members.yaml @@ -0,0 +1,7 @@ +--- # List of valid class members + +- "f: int;" +- "m(): void {}" +- "class B{}" +- "interface I{}" +- "enum E{V1, V2}" diff --git a/migrator/test/staticTS/CTS/09.classes/01.class_declaration/04.class_body/n.class_members.sts b/migrator/test/staticTS/CTS/09.classes/01.class_declaration/04.class_body/n.class_members.sts new file mode 100644 index 000000000..9b3746d48 --- /dev/null +++ b/migrator/test/staticTS/CTS/09.classes/01.class_declaration/04.class_body/n.class_members.sts @@ -0,0 +1,12 @@ +{% for cm in class_members %} +/*--- +desc: Class members appears twice +---*/ + +class A { + {{.cm}} + {{.cm}} +} + +function main(): void {} +{% endfor %} \ No newline at end of file -- Gitee From a0c72fc5cf28d3ddebb96e5309fbd6d4d60e2a77 Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Mon, 12 Sep 2022 11:42:36 +0300 Subject: [PATCH 70/84] Add interface scope --- .../03.scopes/tbd.interface_level.sts | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 migrator/test/staticTS/CTS/04.names_declarations_and_scopes/03.scopes/tbd.interface_level.sts diff --git a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/03.scopes/tbd.interface_level.sts b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/03.scopes/tbd.interface_level.sts new file mode 100644 index 000000000..9de3cbbcd --- /dev/null +++ b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/03.scopes/tbd.interface_level.sts @@ -0,0 +1,10 @@ +/*--- +desc: Interface level scope +---*/ +package scopes; + +interface I { + x: int = 1; +} + +function main(): void {} \ No newline at end of file -- Gitee From 00054a8e8ecaeb17486bb648fab5115ea04c3714 Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Mon, 12 Sep 2022 12:52:09 +0300 Subject: [PATCH 71/84] Rename Predefined Primitive Types => Primitive Types --- .../01.integer_type/integer_types.sts | 0 .../01.integer_type/list.integer_types.yaml | 0 .../02.float_type/float_types.sts | 0 .../02.float_type/float_types_nan.sts | 0 .../02.float_type/list.float_types.yaml | 0 .../03.boolean_type/boolean_type.sts | 0 .../04.char_type/char_type.sts | 0 .../05.void_type/void_type.sts | 0 .../06.default_values_for_primitive_types/default_value.sts | 0 .../06.default_values_for_primitive_types/list.default_value.yaml | 0 .../tbd.implicit_numeric_conversion.sts | 0 11 files changed, 0 insertions(+), 0 deletions(-) rename migrator/test/staticTS/CTS/03.types/{01.predefined_primitive_types => 01.primitive_types}/01.integer_type/integer_types.sts (100%) rename migrator/test/staticTS/CTS/03.types/{01.predefined_primitive_types => 01.primitive_types}/01.integer_type/list.integer_types.yaml (100%) rename migrator/test/staticTS/CTS/03.types/{01.predefined_primitive_types => 01.primitive_types}/02.float_type/float_types.sts (100%) rename migrator/test/staticTS/CTS/03.types/{01.predefined_primitive_types => 01.primitive_types}/02.float_type/float_types_nan.sts (100%) rename migrator/test/staticTS/CTS/03.types/{01.predefined_primitive_types => 01.primitive_types}/02.float_type/list.float_types.yaml (100%) rename migrator/test/staticTS/CTS/03.types/{01.predefined_primitive_types => 01.primitive_types}/03.boolean_type/boolean_type.sts (100%) rename migrator/test/staticTS/CTS/03.types/{01.predefined_primitive_types => 01.primitive_types}/04.char_type/char_type.sts (100%) rename migrator/test/staticTS/CTS/03.types/{01.predefined_primitive_types => 01.primitive_types}/05.void_type/void_type.sts (100%) rename migrator/test/staticTS/CTS/03.types/{01.predefined_primitive_types => 01.primitive_types}/06.default_values_for_primitive_types/default_value.sts (100%) rename migrator/test/staticTS/CTS/03.types/{01.predefined_primitive_types => 01.primitive_types}/06.default_values_for_primitive_types/list.default_value.yaml (100%) rename migrator/test/staticTS/CTS/03.types/{01.predefined_primitive_types => 01.primitive_types}/07.implicit_conversion_for_numeric_types/tbd.implicit_numeric_conversion.sts (100%) diff --git a/migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/01.integer_type/integer_types.sts b/migrator/test/staticTS/CTS/03.types/01.primitive_types/01.integer_type/integer_types.sts similarity index 100% rename from migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/01.integer_type/integer_types.sts rename to migrator/test/staticTS/CTS/03.types/01.primitive_types/01.integer_type/integer_types.sts diff --git a/migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/01.integer_type/list.integer_types.yaml b/migrator/test/staticTS/CTS/03.types/01.primitive_types/01.integer_type/list.integer_types.yaml similarity index 100% rename from migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/01.integer_type/list.integer_types.yaml rename to migrator/test/staticTS/CTS/03.types/01.primitive_types/01.integer_type/list.integer_types.yaml diff --git a/migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/02.float_type/float_types.sts b/migrator/test/staticTS/CTS/03.types/01.primitive_types/02.float_type/float_types.sts similarity index 100% rename from migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/02.float_type/float_types.sts rename to migrator/test/staticTS/CTS/03.types/01.primitive_types/02.float_type/float_types.sts diff --git a/migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/02.float_type/float_types_nan.sts b/migrator/test/staticTS/CTS/03.types/01.primitive_types/02.float_type/float_types_nan.sts similarity index 100% rename from migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/02.float_type/float_types_nan.sts rename to migrator/test/staticTS/CTS/03.types/01.primitive_types/02.float_type/float_types_nan.sts diff --git a/migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/02.float_type/list.float_types.yaml b/migrator/test/staticTS/CTS/03.types/01.primitive_types/02.float_type/list.float_types.yaml similarity index 100% rename from migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/02.float_type/list.float_types.yaml rename to migrator/test/staticTS/CTS/03.types/01.primitive_types/02.float_type/list.float_types.yaml diff --git a/migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/03.boolean_type/boolean_type.sts b/migrator/test/staticTS/CTS/03.types/01.primitive_types/03.boolean_type/boolean_type.sts similarity index 100% rename from migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/03.boolean_type/boolean_type.sts rename to migrator/test/staticTS/CTS/03.types/01.primitive_types/03.boolean_type/boolean_type.sts diff --git a/migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/04.char_type/char_type.sts b/migrator/test/staticTS/CTS/03.types/01.primitive_types/04.char_type/char_type.sts similarity index 100% rename from migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/04.char_type/char_type.sts rename to migrator/test/staticTS/CTS/03.types/01.primitive_types/04.char_type/char_type.sts diff --git a/migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/05.void_type/void_type.sts b/migrator/test/staticTS/CTS/03.types/01.primitive_types/05.void_type/void_type.sts similarity index 100% rename from migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/05.void_type/void_type.sts rename to migrator/test/staticTS/CTS/03.types/01.primitive_types/05.void_type/void_type.sts diff --git a/migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/06.default_values_for_primitive_types/default_value.sts b/migrator/test/staticTS/CTS/03.types/01.primitive_types/06.default_values_for_primitive_types/default_value.sts similarity index 100% rename from migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/06.default_values_for_primitive_types/default_value.sts rename to migrator/test/staticTS/CTS/03.types/01.primitive_types/06.default_values_for_primitive_types/default_value.sts diff --git a/migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/06.default_values_for_primitive_types/list.default_value.yaml b/migrator/test/staticTS/CTS/03.types/01.primitive_types/06.default_values_for_primitive_types/list.default_value.yaml similarity index 100% rename from migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/06.default_values_for_primitive_types/list.default_value.yaml rename to migrator/test/staticTS/CTS/03.types/01.primitive_types/06.default_values_for_primitive_types/list.default_value.yaml diff --git a/migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/07.implicit_conversion_for_numeric_types/tbd.implicit_numeric_conversion.sts b/migrator/test/staticTS/CTS/03.types/01.primitive_types/07.implicit_conversion_for_numeric_types/tbd.implicit_numeric_conversion.sts similarity index 100% rename from migrator/test/staticTS/CTS/03.types/01.predefined_primitive_types/07.implicit_conversion_for_numeric_types/tbd.implicit_numeric_conversion.sts rename to migrator/test/staticTS/CTS/03.types/01.primitive_types/07.implicit_conversion_for_numeric_types/tbd.implicit_numeric_conversion.sts -- Gitee From e83f4995316ca607d9efcd636c192f1d4e346ebc Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Mon, 12 Sep 2022 12:54:54 +0300 Subject: [PATCH 72/84] Rename 3.1.6 => 3.1.7 --- .../default_value.sts | 0 .../list.default_value.yaml | 0 .../tbd.implicit_numeric_conversion.sts | 3 --- 3 files changed, 3 deletions(-) rename migrator/test/staticTS/CTS/03.types/01.primitive_types/{06.default_values_for_primitive_types => 07.default_values_for_primitive_types}/default_value.sts (100%) rename migrator/test/staticTS/CTS/03.types/01.primitive_types/{06.default_values_for_primitive_types => 07.default_values_for_primitive_types}/list.default_value.yaml (100%) delete mode 100644 migrator/test/staticTS/CTS/03.types/01.primitive_types/07.implicit_conversion_for_numeric_types/tbd.implicit_numeric_conversion.sts diff --git a/migrator/test/staticTS/CTS/03.types/01.primitive_types/06.default_values_for_primitive_types/default_value.sts b/migrator/test/staticTS/CTS/03.types/01.primitive_types/07.default_values_for_primitive_types/default_value.sts similarity index 100% rename from migrator/test/staticTS/CTS/03.types/01.primitive_types/06.default_values_for_primitive_types/default_value.sts rename to migrator/test/staticTS/CTS/03.types/01.primitive_types/07.default_values_for_primitive_types/default_value.sts diff --git a/migrator/test/staticTS/CTS/03.types/01.primitive_types/06.default_values_for_primitive_types/list.default_value.yaml b/migrator/test/staticTS/CTS/03.types/01.primitive_types/07.default_values_for_primitive_types/list.default_value.yaml similarity index 100% rename from migrator/test/staticTS/CTS/03.types/01.primitive_types/06.default_values_for_primitive_types/list.default_value.yaml rename to migrator/test/staticTS/CTS/03.types/01.primitive_types/07.default_values_for_primitive_types/list.default_value.yaml diff --git a/migrator/test/staticTS/CTS/03.types/01.primitive_types/07.implicit_conversion_for_numeric_types/tbd.implicit_numeric_conversion.sts b/migrator/test/staticTS/CTS/03.types/01.primitive_types/07.implicit_conversion_for_numeric_types/tbd.implicit_numeric_conversion.sts deleted file mode 100644 index d620c7ed2..000000000 --- a/migrator/test/staticTS/CTS/03.types/01.primitive_types/07.implicit_conversion_for_numeric_types/tbd.implicit_numeric_conversion.sts +++ /dev/null @@ -1,3 +0,0 @@ -/*--- -desc: Implicit numeric conversion for primitive type ----*/ \ No newline at end of file -- Gitee From 376bf2674cac0c7d97a220965fd715b804ff5f84 Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Mon, 12 Sep 2022 12:55:47 +0300 Subject: [PATCH 73/84] Rename 3.1.5 => 3.1.6 --- .../{05.void_type => 06.void_type}/void_type.sts | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename migrator/test/staticTS/CTS/03.types/01.primitive_types/{05.void_type => 06.void_type}/void_type.sts (100%) diff --git a/migrator/test/staticTS/CTS/03.types/01.primitive_types/05.void_type/void_type.sts b/migrator/test/staticTS/CTS/03.types/01.primitive_types/06.void_type/void_type.sts similarity index 100% rename from migrator/test/staticTS/CTS/03.types/01.primitive_types/05.void_type/void_type.sts rename to migrator/test/staticTS/CTS/03.types/01.primitive_types/06.void_type/void_type.sts -- Gitee From d3cc27d08c35020e91df63e57b38806216876d09 Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Mon, 12 Sep 2022 14:34:34 +0300 Subject: [PATCH 74/84] Rename 3.1.3 => 3.1.5 --- .../boolean_type.sts | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename migrator/test/staticTS/CTS/03.types/01.primitive_types/{03.boolean_type => 05.boolean_type_and_operations}/boolean_type.sts (100%) diff --git a/migrator/test/staticTS/CTS/03.types/01.primitive_types/03.boolean_type/boolean_type.sts b/migrator/test/staticTS/CTS/03.types/01.primitive_types/05.boolean_type_and_operations/boolean_type.sts similarity index 100% rename from migrator/test/staticTS/CTS/03.types/01.primitive_types/03.boolean_type/boolean_type.sts rename to migrator/test/staticTS/CTS/03.types/01.primitive_types/05.boolean_type_and_operations/boolean_type.sts -- Gitee From d2ca76d44e047b1537fe89ffb59ae59a5a469739 Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Mon, 12 Sep 2022 14:35:36 +0300 Subject: [PATCH 75/84] Rename 3.1.2 => 3.1.3 --- .../{02.float_type => 03.float_types}/float_types.sts | 0 .../{02.float_type => 03.float_types}/float_types_nan.sts | 0 .../{02.float_type => 03.float_types}/list.float_types.yaml | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename migrator/test/staticTS/CTS/03.types/01.primitive_types/{02.float_type => 03.float_types}/float_types.sts (100%) rename migrator/test/staticTS/CTS/03.types/01.primitive_types/{02.float_type => 03.float_types}/float_types_nan.sts (100%) rename migrator/test/staticTS/CTS/03.types/01.primitive_types/{02.float_type => 03.float_types}/list.float_types.yaml (100%) diff --git a/migrator/test/staticTS/CTS/03.types/01.primitive_types/02.float_type/float_types.sts b/migrator/test/staticTS/CTS/03.types/01.primitive_types/03.float_types/float_types.sts similarity index 100% rename from migrator/test/staticTS/CTS/03.types/01.primitive_types/02.float_type/float_types.sts rename to migrator/test/staticTS/CTS/03.types/01.primitive_types/03.float_types/float_types.sts diff --git a/migrator/test/staticTS/CTS/03.types/01.primitive_types/02.float_type/float_types_nan.sts b/migrator/test/staticTS/CTS/03.types/01.primitive_types/03.float_types/float_types_nan.sts similarity index 100% rename from migrator/test/staticTS/CTS/03.types/01.primitive_types/02.float_type/float_types_nan.sts rename to migrator/test/staticTS/CTS/03.types/01.primitive_types/03.float_types/float_types_nan.sts diff --git a/migrator/test/staticTS/CTS/03.types/01.primitive_types/02.float_type/list.float_types.yaml b/migrator/test/staticTS/CTS/03.types/01.primitive_types/03.float_types/list.float_types.yaml similarity index 100% rename from migrator/test/staticTS/CTS/03.types/01.primitive_types/02.float_type/list.float_types.yaml rename to migrator/test/staticTS/CTS/03.types/01.primitive_types/03.float_types/list.float_types.yaml -- Gitee From 11dc04c5087550799549a0991a15373be48d2146 Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Mon, 12 Sep 2022 14:39:09 +0300 Subject: [PATCH 76/84] Rename 3.4.1 => 3.2.4 & 3.4.2 => 3.2.5 --- .../04.the_object_class}/object_type.sts | 0 .../05.the_string_class}/string_type.sts | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename migrator/test/staticTS/CTS/03.types/{04.predefined_named_types/01.object_type => 02.reference_types/04.the_object_class}/object_type.sts (100%) rename migrator/test/staticTS/CTS/03.types/{04.predefined_named_types/02.string_type => 02.reference_types/05.the_string_class}/string_type.sts (100%) diff --git a/migrator/test/staticTS/CTS/03.types/04.predefined_named_types/01.object_type/object_type.sts b/migrator/test/staticTS/CTS/03.types/02.reference_types/04.the_object_class/object_type.sts similarity index 100% rename from migrator/test/staticTS/CTS/03.types/04.predefined_named_types/01.object_type/object_type.sts rename to migrator/test/staticTS/CTS/03.types/02.reference_types/04.the_object_class/object_type.sts diff --git a/migrator/test/staticTS/CTS/03.types/04.predefined_named_types/02.string_type/string_type.sts b/migrator/test/staticTS/CTS/03.types/02.reference_types/05.the_string_class/string_type.sts similarity index 100% rename from migrator/test/staticTS/CTS/03.types/04.predefined_named_types/02.string_type/string_type.sts rename to migrator/test/staticTS/CTS/03.types/02.reference_types/05.the_string_class/string_type.sts -- Gitee From 9749e5ede2e61bb2434b0325837c60c4cb2e2f2c Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Mon, 12 Sep 2022 14:41:34 +0300 Subject: [PATCH 77/84] Rename 3.3 => 3.2.2 --- .../02.named_types}/list.named_types.yaml | 0 .../02.named_types}/list.named_types_generics.yaml | 0 .../02.named_types}/named_types.sts | 0 .../02.named_types}/named_types_generics.sts | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename migrator/test/staticTS/CTS/03.types/{03.named_types => 02.reference_types/02.named_types}/list.named_types.yaml (100%) rename migrator/test/staticTS/CTS/03.types/{03.named_types => 02.reference_types/02.named_types}/list.named_types_generics.yaml (100%) rename migrator/test/staticTS/CTS/03.types/{03.named_types => 02.reference_types/02.named_types}/named_types.sts (100%) rename migrator/test/staticTS/CTS/03.types/{03.named_types => 02.reference_types/02.named_types}/named_types_generics.sts (100%) diff --git a/migrator/test/staticTS/CTS/03.types/03.named_types/list.named_types.yaml b/migrator/test/staticTS/CTS/03.types/02.reference_types/02.named_types/list.named_types.yaml similarity index 100% rename from migrator/test/staticTS/CTS/03.types/03.named_types/list.named_types.yaml rename to migrator/test/staticTS/CTS/03.types/02.reference_types/02.named_types/list.named_types.yaml diff --git a/migrator/test/staticTS/CTS/03.types/03.named_types/list.named_types_generics.yaml b/migrator/test/staticTS/CTS/03.types/02.reference_types/02.named_types/list.named_types_generics.yaml similarity index 100% rename from migrator/test/staticTS/CTS/03.types/03.named_types/list.named_types_generics.yaml rename to migrator/test/staticTS/CTS/03.types/02.reference_types/02.named_types/list.named_types_generics.yaml diff --git a/migrator/test/staticTS/CTS/03.types/03.named_types/named_types.sts b/migrator/test/staticTS/CTS/03.types/02.reference_types/02.named_types/named_types.sts similarity index 100% rename from migrator/test/staticTS/CTS/03.types/03.named_types/named_types.sts rename to migrator/test/staticTS/CTS/03.types/02.reference_types/02.named_types/named_types.sts diff --git a/migrator/test/staticTS/CTS/03.types/03.named_types/named_types_generics.sts b/migrator/test/staticTS/CTS/03.types/02.reference_types/02.named_types/named_types_generics.sts similarity index 100% rename from migrator/test/staticTS/CTS/03.types/03.named_types/named_types_generics.sts rename to migrator/test/staticTS/CTS/03.types/02.reference_types/02.named_types/named_types_generics.sts -- Gitee From f8e26e33979f05a4489d0ef85caca6004216fd2b Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Mon, 12 Sep 2022 14:43:00 +0300 Subject: [PATCH 78/84] Rename chapter, add instanceof --- .../instanceof.sts | 0 .../list.instanceof.yaml | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename migrator/test/staticTS/CTS/07.expressions/{23.type_comparison_operator => 23.type_comparison_operator_instanceof}/instanceof.sts (100%) rename migrator/test/staticTS/CTS/07.expressions/{23.type_comparison_operator => 23.type_comparison_operator_instanceof}/list.instanceof.yaml (100%) diff --git a/migrator/test/staticTS/CTS/07.expressions/23.type_comparison_operator/instanceof.sts b/migrator/test/staticTS/CTS/07.expressions/23.type_comparison_operator_instanceof/instanceof.sts similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/23.type_comparison_operator/instanceof.sts rename to migrator/test/staticTS/CTS/07.expressions/23.type_comparison_operator_instanceof/instanceof.sts diff --git a/migrator/test/staticTS/CTS/07.expressions/23.type_comparison_operator/list.instanceof.yaml b/migrator/test/staticTS/CTS/07.expressions/23.type_comparison_operator_instanceof/list.instanceof.yaml similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/23.type_comparison_operator/list.instanceof.yaml rename to migrator/test/staticTS/CTS/07.expressions/23.type_comparison_operator_instanceof/list.instanceof.yaml -- Gitee From 55c2d0b4d691b61f469f5e4472d13dfc348a191c Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Mon, 12 Sep 2022 14:46:13 +0300 Subject: [PATCH 79/84] Remove 3.2 --- .../staticTS/CTS/03.types/02.array_type/array_type.sts | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 migrator/test/staticTS/CTS/03.types/02.array_type/array_type.sts diff --git a/migrator/test/staticTS/CTS/03.types/02.array_type/array_type.sts b/migrator/test/staticTS/CTS/03.types/02.array_type/array_type.sts deleted file mode 100644 index ec6bbe9cc..000000000 --- a/migrator/test/staticTS/CTS/03.types/02.array_type/array_type.sts +++ /dev/null @@ -1,7 +0,0 @@ -/*--- -desc: Array type ----*/ - -let a: int[]; -function main(): void {} - -- Gitee From b39cb8655e7a972590fda83080217a5ed9dcddfd Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Mon, 12 Sep 2022 15:11:05 +0300 Subject: [PATCH 80/84] Add function declarations --- .../06.function_declarations/function_decl.sts | 11 +++++++++++ .../06.function_declarations/list.function_decls.yaml | 8 ++++++++ .../06.function_declarations/n.nested_function.sts | 7 +++++++ 3 files changed, 26 insertions(+) create mode 100644 migrator/test/staticTS/CTS/04.names_declarations_and_scopes/06.function_declarations/function_decl.sts create mode 100644 migrator/test/staticTS/CTS/04.names_declarations_and_scopes/06.function_declarations/list.function_decls.yaml create mode 100644 migrator/test/staticTS/CTS/04.names_declarations_and_scopes/06.function_declarations/n.nested_function.sts diff --git a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/06.function_declarations/function_decl.sts b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/06.function_declarations/function_decl.sts new file mode 100644 index 000000000..37d10dd34 --- /dev/null +++ b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/06.function_declarations/function_decl.sts @@ -0,0 +1,11 @@ +{% for fd in function_decls %} + +/*--- +desc: Function declaration +---*/ + +{{.fd}} + +function main(): void {} + +{% endfor %} \ No newline at end of file diff --git a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/06.function_declarations/list.function_decls.yaml b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/06.function_declarations/list.function_decls.yaml new file mode 100644 index 000000000..3e516aa9f --- /dev/null +++ b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/06.function_declarations/list.function_decls.yaml @@ -0,0 +1,8 @@ +--- # List of valid function declarations + +- "function f(): void {}" +- "function f(a: int): void {}" +- "function f(a: int, b: long): void {}" +- "function f(): int {return 0;}" +- "function f(a: int, b: long): int {return 0;}" + diff --git a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/06.function_declarations/n.nested_function.sts b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/06.function_declarations/n.nested_function.sts new file mode 100644 index 000000000..cce08cbc7 --- /dev/null +++ b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/06.function_declarations/n.nested_function.sts @@ -0,0 +1,7 @@ +/*--- +desc: Functions are allowed only at toplevel +---*/ + +function main(): void { + function nested(): void {} +} \ No newline at end of file -- Gitee From 12ca3b164328fd004fe262f7b4dd4c8126c5de08 Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Mon, 12 Sep 2022 15:13:56 +0300 Subject: [PATCH 81/84] Add variadic parameters --- .../01.variadic_parameters/fn_variadic.sts | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 migrator/test/staticTS/CTS/04.names_declarations_and_scopes/06.function_declarations/01.variadic_parameters/fn_variadic.sts diff --git a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/06.function_declarations/01.variadic_parameters/fn_variadic.sts b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/06.function_declarations/01.variadic_parameters/fn_variadic.sts new file mode 100644 index 000000000..1b8c7bb71 --- /dev/null +++ b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/06.function_declarations/01.variadic_parameters/fn_variadic.sts @@ -0,0 +1,11 @@ +/*--- +desc: Variadic parameters +---*/ + +function foo(...a: int): void { + assert true; +} + +function main(): void { + assert foo(1,2,3); +} \ No newline at end of file -- Gitee From 5feb36e884859bbc4e8745751c3161916a8487f2 Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Mon, 12 Sep 2022 15:22:28 +0300 Subject: [PATCH 82/84] Add null initializer --- .../n.null_initializer.sts | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/04.type_inference_from_initializer/n.null_initializer.sts diff --git a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/04.type_inference_from_initializer/n.null_initializer.sts b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/04.type_inference_from_initializer/n.null_initializer.sts new file mode 100644 index 000000000..ace20c4e5 --- /dev/null +++ b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/04.type_inference_from_initializer/n.null_initializer.sts @@ -0,0 +1,8 @@ +/*--- +desc: Null initializer forbidden +corner-case: true +---*/ + +let x = null; + +function main(): void {} \ No newline at end of file -- Gitee From 3b3072392c4963e417e64f39259819f15527a0b0 Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Mon, 26 Sep 2022 14:09:04 +0300 Subject: [PATCH 83/84] Implement ne. prefix (fail on execution) --- .../13.assert_statement/{n.assert.sts => ne.assert.sts} | 0 .../{n.assert_str.sts => ne.assert_str.sts} | 0 .../{n.panic_statement.sts => ne.panic_statement.sts} | 0 migrator/test/staticTS/formatChecker/run_tests.py | 4 ++-- migrator/test/staticTS/formatChecker/utils/constants.py | 1 + migrator/test/staticTS/formatChecker/utils/test_case.py | 4 ++-- 6 files changed, 5 insertions(+), 4 deletions(-) rename migrator/test/staticTS/CTS/08.statements/13.assert_statement/{n.assert.sts => ne.assert.sts} (100%) rename migrator/test/staticTS/CTS/08.statements/13.assert_statement/{n.assert_str.sts => ne.assert_str.sts} (100%) rename migrator/test/staticTS/CTS/08.statements/16.panic_statement/{n.panic_statement.sts => ne.panic_statement.sts} (100%) diff --git a/migrator/test/staticTS/CTS/08.statements/13.assert_statement/n.assert.sts b/migrator/test/staticTS/CTS/08.statements/13.assert_statement/ne.assert.sts similarity index 100% rename from migrator/test/staticTS/CTS/08.statements/13.assert_statement/n.assert.sts rename to migrator/test/staticTS/CTS/08.statements/13.assert_statement/ne.assert.sts diff --git a/migrator/test/staticTS/CTS/08.statements/13.assert_statement/n.assert_str.sts b/migrator/test/staticTS/CTS/08.statements/13.assert_statement/ne.assert_str.sts similarity index 100% rename from migrator/test/staticTS/CTS/08.statements/13.assert_statement/n.assert_str.sts rename to migrator/test/staticTS/CTS/08.statements/13.assert_statement/ne.assert_str.sts diff --git a/migrator/test/staticTS/CTS/08.statements/16.panic_statement/n.panic_statement.sts b/migrator/test/staticTS/CTS/08.statements/16.panic_statement/ne.panic_statement.sts similarity index 100% rename from migrator/test/staticTS/CTS/08.statements/16.panic_statement/n.panic_statement.sts rename to migrator/test/staticTS/CTS/08.statements/16.panic_statement/ne.panic_statement.sts diff --git a/migrator/test/staticTS/formatChecker/run_tests.py b/migrator/test/staticTS/formatChecker/run_tests.py index de8286f20..2eb69cb1c 100644 --- a/migrator/test/staticTS/formatChecker/run_tests.py +++ b/migrator/test/staticTS/formatChecker/run_tests.py @@ -18,7 +18,7 @@ from pathlib import Path from utils.file_structure import walk_test_subdirs from utils.metainformation import InvalidMetaException, find_all_metas from utils.exceptions import InvalidFileFormatException, InvalidFileStructureException -from utils.constants import JAR_EXTENSION, TEMPLATE_EXTENSION, NEGATIVE_PREFIX +from utils.constants import JAR_EXTENSION, TEMPLATE_EXTENSION, NEGATIVE_PREFIX, NEGATIVE_EXECUTION_PREFIX import subprocess import argparse import os.path as ospath @@ -82,7 +82,7 @@ class RunStats: self.passed.append(path) def test_should_pass(filepath: Path) -> bool: - return not filepath.name.startswith(NEGATIVE_PREFIX) + return not (filepath.name.startswith(NEGATIVE_PREFIX) or filepath.name.startswith(NEGATIVE_EXECUTION_PREFIX)) def run_test(filepath: Path, runnerpath: Path) -> bool: """ diff --git a/migrator/test/staticTS/formatChecker/utils/constants.py b/migrator/test/staticTS/formatChecker/utils/constants.py index 7d52e295a..11e2f71d1 100644 --- a/migrator/test/staticTS/formatChecker/utils/constants.py +++ b/migrator/test/staticTS/formatChecker/utils/constants.py @@ -15,6 +15,7 @@ JAR_EXTENSION = ".jar" # Prefixes LIST_PREFIX = "list." NEGATIVE_PREFIX = "n." +NEGATIVE_EXECUTION_PREFIX = "ne." SKIP_PREFIX = "tbd." # Jinja diff --git a/migrator/test/staticTS/formatChecker/utils/test_case.py b/migrator/test/staticTS/formatChecker/utils/test_case.py index c2e02b19a..7cc02347f 100644 --- a/migrator/test/staticTS/formatChecker/utils/test_case.py +++ b/migrator/test/staticTS/formatChecker/utils/test_case.py @@ -3,11 +3,11 @@ from pathlib import Path from re import template from typing import Tuple -from utils.constants import NEGATIVE_PREFIX, SKIP_PREFIX +from utils.constants import NEGATIVE_PREFIX, NEGATIVE_EXECUTION_PREFIX, SKIP_PREFIX def is_negative(path: Path) -> bool: - return path.name.startswith(NEGATIVE_PREFIX) + return path.name.startswith(NEGATIVE_PREFIX) or path.name.startswith(NEGATIVE_EXECUTION_PREFIX) def should_be_skipped(path: Path) -> bool: -- Gitee From 68cf55e415434b64ad43796f38bd5c7252979842 Mon Sep 17 00:00:00 2001 From: Dmitry Solomennikov Date: Fri, 7 Oct 2022 14:27:59 +0300 Subject: [PATCH 84/84] Rename *.sts to *.ets --- .../{multi_line_comment.sts => multi_line_comment.ets} | 0 .../{one_line_comment.sts => one_line_comment.ets} | 0 .../02.tokens/01.whitespaces/.gitattributes | 2 +- .../01.whitespaces/{whitespaces.sts => whitespaces.ets} | 0 .../02.tokens/02.line_separators/.gitattributes | 2 +- .../{line_separators.sts => line_separators.ets} | 0 .../03.identifiers/{identifiers.sts => identifiers.ets} | 0 .../{identifiers_continue.sts => identifiers_continue.ets} | 0 .../{identifiers_dollar.sts => identifiers_dollar.ets} | 0 .../{identifiers_start.sts => identifiers_start.ets} | 0 .../04.keywords/{n.keywords.sts => n.keywords.ets} | 0 .../04.keywords/{n.types.sts => n.types.ets} | 0 .../05.operators_and_punctuation/{tbd.sts => tbd.ets} | 0 .../{int_literals.sts => int_literals.ets} | 0 .../{n.bad_int_literals.sts => n.bad_int_literals.ets} | 0 .../{float_literals.sts => float_literals.ets} | 0 .../{boolean_literals.sts => boolean_literals.ets} | 0 .../{string_literals.sts => string_literals.ets} | 0 ...string_literals.sts => tbd.multiline_string_literals.ets} | 0 ...on.sts => tbd.string_literals_escapes_n_continuation.ets} | 0 .../{char_literals.sts => char_literals.ets} | 0 .../06.null_literals/{null_literal.sts => null_literal.ets} | 0 ...n_insertion.sts => tbd.automatic_semicolon_insertion.ets} | 0 .../01.integer_type/{integer_types.sts => integer_types.ets} | 0 .../03.float_types/{float_types.sts => float_types.ets} | 0 .../{float_types_nan.sts => float_types_nan.ets} | 0 .../04.char_type/{char_type.sts => char_type.ets} | 0 .../{boolean_type.sts => boolean_type.ets} | 0 .../06.void_type/{void_type.sts => void_type.ets} | 0 .../{default_value.sts => default_value.ets} | 0 .../02.named_types/{named_types.sts => named_types.ets} | 0 .../{named_types_generics.sts => named_types_generics.ets} | 0 .../04.the_object_class/{object_type.sts => object_type.ets} | 0 .../05.the_string_class/{string_type.sts => string_type.ets} | 0 .../06.function_types/list.function_types.yaml | 5 +++++ .../{tbd.type_reference.sts => tbd.type_reference.ets} | 0 .../01.names/{qualified_name.sts => qualified_name.ets} | 0 .../{n.unique_block_decl.sts => n.unique_block_decl.ets} | 0 .../{n.unique_class_decl.sts => n.unique_class_decl.ets} | 0 .../{n.unique_decl_name.sts => n.unique_decl_name.ets} | 0 .../{n.unique_enum_decl.sts => n.unique_enum_decl.ets} | 0 .../{n.unique_func_decl.sts => n.unique_func_decl.ets} | 0 .../{n.unique_intf_decl.sts => n.unique_intf_decl.ets} | 0 .../03.scopes/{class_level.sts => class_level.ets} | 0 .../03.scopes/{n.hoisting.sts => n.hoisting.ets} | 0 .../03.scopes/{package_level.sts => package_level.ets} | 0 .../03.scopes/{tbd.enum_level.sts => tbd.enum_level.ets} | 0 .../{tbd.interface_level.sts => tbd.interface_level.ets} | 0 .../{n.var_decl.sts => n.var_decl.ets} | 0 ...itialize_before_use.sts => tbd.initialize_before_use.ets} | 0 .../01.variable_declarations/{var_decl.sts => var_decl.ets} | 0 .../{const_decl.sts => const_decl.ets} | 0 .../{n.const_decl.sts => n.const_decl.ets} | 0 ...lizer_compatibility.sts => initializer_compatibility.ets} | 0 .../{n.null_initializer.sts => n.null_initializer.ets} | 0 .../{fn_variadic.sts => fn_variadic.ets} | 0 .../{function_decl.sts => function_decl.ets} | 0 .../{n.nested_function.sts => n.nested_function.ets} | 0 ...lf_dependency.sts => n.generic_class_self_dependency.ets} | 0 ...g_constraint.sts => n.generic_class_wrong_constraint.ets} | 0 .../{widening.sts => widening.ets} | 0 .../{boxing_conversion.sts => boxing_conversion.ets} | 0 .../{boxing_coversion_nan.sts => boxing_coversion_nan.ets} | 0 .../{unboxing_conversion.sts => unboxing_conversion.ets} | 0 .../{int_parens.sts => int_parens.ets} | 0 .../{arg_order_function.sts => arg_order_function.ets} | 0 .../{class_literal.sts => class_literal.ets} | 0 .../{array_literal.sts => array_literal.ets} | 0 .../{paren_expr.sts => paren_expr.ets} | 0 .../{array_access.sts => array_access.ets} | 0 ...tion_invocation_expr.sts => function_invocation_expr.ets} | 0 .../{class_instance.sts => class_instance.ets} | 0 .../{array_creation.sts => array_creation.ets} | 0 .../{postfix_increment.sts => postfix_increment.ets} | 0 .../{postfix_decrement.sts => postfix_decrement.ets} | 0 .../{prefix_increment.sts => prefix_increment.ets} | 0 .../{prefix_decrement.sts => prefix_decrement.ets} | 0 .../{unary_plus.sts => unary_plus.ets} | 0 .../{unary_minus_corner.sts => unary_minus_corner.ets} | 0 .../{unary_minus_inbound.sts => unary_minus_inbound.ets} | 0 .../{unary_minus_onbound.sts => unary_minus_onbound.ets} | 0 .../{bitwise_complement.sts => bitwise_complement.ets} | 0 .../{tbd.bitwise_long_int.sts => tbd.bitwise_long_int.ets} | 0 .../{logical_complement.sts => logical_complement.ets} | 0 .../{integer_mul.sts => integer_mul.ets} | 0 .../01.multiplication_operator/{nan_inf.sts => nan_inf.ets} | 0 .../02.division_operator/{nan_inf.sts => nan_inf.ets} | 0 ...tbd.float_div_overflow.sts => tbd.float_div_overflow.ets} | 0 .../{tbd.float_division.sts => tbd.float_division.ets} | 0 .../{tbd.int_div_overflow.sts => tbd.int_div_overflow.ets} | 0 .../{integer_remainder.sts => integer_remainder.ets} | 0 .../03.remainder_operator/{nan_inf.sts => nan_inf.ets} | 0 .../{string_concat.sts => string_concat.ets} | 0 .../{nan_inf.sts => nan_inf.ets} | 0 .../21.shift_operators/{n.shift_int.sts => n.shift_int.ets} | 0 .../21.shift_operators/{rshift_int.sts => rshift_int.ets} | 0 .../{float_comparison.sts => float_comparison.ets} | 0 .../{integer_comparison.sts => integer_comparison.ets} | 0 .../{instanceof.sts => instanceof.ets} | 0 .../{float_equality_00.sts => float_equality_00.ets} | 0 .../{float_equality_01.sts => float_equality_01.ets} | 0 .../{float_equality_02.sts => float_equality_02.ets} | 0 .../{float_equality_03.sts => float_equality_03.ets} | 0 .../{float_equality_04.sts => float_equality_04.ets} | 0 .../{boolean_eq.sts => boolean_eq.ets} | 0 .../{string_eq.sts => string_eq.ets} | 0 .../{general_equality_00.sts => general_equality_00.ets} | 0 .../{general_equality_01.sts => general_equality_01.ets} | 0 .../{general_equality_02.sts => general_equality_02.ets} | 0 .../{integer_and.sts => integer_and.ets} | 0 .../{integer_or.sts => integer_or.ets} | 0 .../{integer_xor.sts => integer_xor.ets} | 0 ...rge_size_operations.sts => tbd.large_size_operations.ets} | 0 .../{logical_bitwise_bool.sts => logical_bitwise_bool.ets} | 0 ...gical_bitwise_boolean.sts => logical_bitwise_boolean.ets} | 0 .../{conditional_and_bool.sts => conditional_and_bool.ets} | 0 ...nditional_and_boolean.sts => conditional_and_boolean.ets} | 0 ...nditional_and_bool.sts => tbd.n.conditional_and_bool.ets} | 0 .../{conditional_or_bool.sts => conditional_or_bool.ets} | 0 ...conditional_or_boolean.sts => conditional_or_boolean.ets} | 0 ...conditional_or_bool.sts => tbd.n.conditional_or_bool.ets} | 0 ..._evaluation.sts => conditional_expression_evaluation.ets} | 0 ...expression_order.sts => conditional_expression_order.ets} | 0 .../{expression_statement.sts => expression_statement.ets} | 0 .../02.block/{block_statement.sts => block_statement.ets} | 0 .../{labeled_statement.sts => labeled_statement.ets} | 0 .../{local_class.sts => local_class.ets} | 0 .../{local_const.sts => local_const.ets} | 0 .../04.local_declarations/{local_var.sts => local_var.ets} | 0 .../{n.local_class.sts => n.local_class.ets} | 0 .../{n.local_const.sts => n.local_const.ets} | 0 .../{n.local_var.sts => n.local_var.ets} | 0 .../CTS/08.statements/05.if_statement/{if.sts => if.ets} | 0 .../{if_not_executed.sts => if_not_executed.ets} | 0 .../05.if_statement/{nested_if.sts => nested_if.ets} | 0 .../06.while_and_do_statements/{do.sts => do.ets} | 0 .../06.while_and_do_statements/{while.sts => while.ets} | 0 .../{while_not_executed.sts => while_not_executed.ets} | 0 .../07.for_statement/{for_existing.sts => for_existing.ets} | 0 .../07.for_statement/{for_new.sts => for_new.ets} | 0 .../{for_new_implicit.sts => for_new_implicit.ets} | 0 .../08.for_of_statement/{for_of_new.sts => for_of_new.ets} | 0 .../{for_of_new_type.sts => for_of_new_type.ets} | 0 .../09.break_statement/{break.sts => break.ets} | 0 .../{continue_while.sts => continue_while.ets} | 0 .../11.return_statement/{return.sts => return.ets} | 0 .../{n.switch_duplicate.sts => n.switch_duplicate.ets} | 0 .../12.switch_statement/{switch.sts => switch.ets} | 0 .../{switch_block.sts => switch_block.ets} | 0 .../12.switch_statement/{switch_char.sts => switch_char.ets} | 0 .../12.switch_statement/{switch_enum.sts => switch_enum.ets} | 0 .../13.assert_statement/{assert.sts => assert.ets} | 0 .../13.assert_statement/{ne.assert.sts => ne.assert.ets} | 0 .../{ne.assert_str.sts => ne.assert_str.ets} | 0 .../{ne.panic_statement.sts => ne.panic_statement.ets} | 0 .../01.abstract_classes/{abstract.sts => abstract.ets} | 0 .../{abstract_method.sts => abstract_method.ets} | 0 ...n.abstract_instantiate.sts => n.abstract_instantiate.ets} | 0 .../{n.abstract_method.sts => n.abstract_method.ets} | 0 .../{n.abstract_open.sts => n.abstract_open.ets} | 0 .../02.open_classes/{n.open_class.sts => n.open_class.ets} | 0 .../02.open_classes/{open_class.sts => open_class.ets} | 0 .../04.class_body/{class_members.sts => class_members.ets} | 0 .../{n.class_members.sts => n.class_members.ets} | 0 .../09.classes/01.class_declaration/{point.sts => point.ets} | 0 ...rface_declaration.sts => empty_interface_declaration.ets} | 0 ....sts => empty_interface_declaration_with_type_params.ets} | 0 .../{interface_fields.sts => interface_fields.ets} | 0 ..._without_types.sts => interface_fields_without_types.ets} | 0 ...without_type.sts => n.interface_extends_without_type.ets} | 0 ...ral_interface_fields.sts => several_interface_fields.ets} | 0 .../{interface_field_decl.sts => interface_field_decl.ets} | 0 ..._interface_methods.sts => n.static_interface_methods.ets} | 0 ...ic_interface_methods.sts => static_interface_methods.ets} | 0 ...interface_methods.sts => n.private_interface_methods.ets} | 0 ...ods_static.sts => n.private_interface_methods_static.ets} | 0 ...e_interface_methods.sts => private_interface_methods.ets} | 0 ...y_number_of_constants.sts => any_number_of_constants.ets} | 0 .../01.enum_constants/{n.empty_enum.sts => n.empty_enum.ets} | 0 .../{n.repeating_constants.sts => n.repeating_constants.ets} | 0 .../{n.trailing_comma_enum.sts => n.trailing_comma_enum.ets} | 0 .../01.enum_constants/{simple_enum.sts => simple_enum.ets} | 0 ...ype_methods_valueof.sts => enum_type_methods_valueof.ets} | 0 ..._type_methods_values.sts => enum_type_methods_values.ets} | 0 ...enum_constant_ordinals.sts => enum_constant_ordinals.ets} | 0 ...um_constant_to_string.sts => enum_constant_to_string.ets} | 0 .../02.import_declarations/{import.sts => import.ets} | 0 .../02.import_declarations/{import_as.sts => import_as.ets} | 0 .../{n.import_all_as.sts => n.import_all_as.ets} | 0 .../{export_declarations.sts => export_declarations.ets} | 0 ..._declarations.sts => n.exported_grouped_declarations.ets} | 0 .../{multiple_entrypoints.sts => multiple_entrypoints.ets} | 0 192 files changed, 7 insertions(+), 2 deletions(-) rename migrator/test/staticTS/CTS/02.lexical_elements/01.comments/{multi_line_comment.sts => multi_line_comment.ets} (100%) rename migrator/test/staticTS/CTS/02.lexical_elements/01.comments/{one_line_comment.sts => one_line_comment.ets} (100%) rename migrator/test/staticTS/CTS/02.lexical_elements/02.tokens/01.whitespaces/{whitespaces.sts => whitespaces.ets} (100%) rename migrator/test/staticTS/CTS/02.lexical_elements/02.tokens/02.line_separators/{line_separators.sts => line_separators.ets} (100%) rename migrator/test/staticTS/CTS/02.lexical_elements/03.identifiers/{identifiers.sts => identifiers.ets} (100%) rename migrator/test/staticTS/CTS/02.lexical_elements/03.identifiers/{identifiers_continue.sts => identifiers_continue.ets} (100%) rename migrator/test/staticTS/CTS/02.lexical_elements/03.identifiers/{identifiers_dollar.sts => identifiers_dollar.ets} (100%) rename migrator/test/staticTS/CTS/02.lexical_elements/03.identifiers/{identifiers_start.sts => identifiers_start.ets} (100%) rename migrator/test/staticTS/CTS/02.lexical_elements/04.keywords/{n.keywords.sts => n.keywords.ets} (100%) rename migrator/test/staticTS/CTS/02.lexical_elements/04.keywords/{n.types.sts => n.types.ets} (100%) rename migrator/test/staticTS/CTS/02.lexical_elements/05.operators_and_punctuation/{tbd.sts => tbd.ets} (100%) rename migrator/test/staticTS/CTS/02.lexical_elements/06.literals/01.integer_literals/{int_literals.sts => int_literals.ets} (100%) rename migrator/test/staticTS/CTS/02.lexical_elements/06.literals/01.integer_literals/{n.bad_int_literals.sts => n.bad_int_literals.ets} (100%) rename migrator/test/staticTS/CTS/02.lexical_elements/06.literals/02.floating_point_literals/{float_literals.sts => float_literals.ets} (100%) rename migrator/test/staticTS/CTS/02.lexical_elements/06.literals/03.boolean_literals/{boolean_literals.sts => boolean_literals.ets} (100%) rename migrator/test/staticTS/CTS/02.lexical_elements/06.literals/04.string_literals/{string_literals.sts => string_literals.ets} (100%) rename migrator/test/staticTS/CTS/02.lexical_elements/06.literals/04.string_literals/{tbd.multiline_string_literals.sts => tbd.multiline_string_literals.ets} (100%) rename migrator/test/staticTS/CTS/02.lexical_elements/06.literals/04.string_literals/{tbd.string_literals_escapes_n_continuation.sts => tbd.string_literals_escapes_n_continuation.ets} (100%) rename migrator/test/staticTS/CTS/02.lexical_elements/06.literals/05.char_literals/{char_literals.sts => char_literals.ets} (100%) rename migrator/test/staticTS/CTS/02.lexical_elements/06.literals/06.null_literals/{null_literal.sts => null_literal.ets} (100%) rename migrator/test/staticTS/CTS/02.lexical_elements/07.automatic_semicolon_insertion/{tbd.automatic_semicolon_insertion.sts => tbd.automatic_semicolon_insertion.ets} (100%) rename migrator/test/staticTS/CTS/03.types/01.primitive_types/01.integer_type/{integer_types.sts => integer_types.ets} (100%) rename migrator/test/staticTS/CTS/03.types/01.primitive_types/03.float_types/{float_types.sts => float_types.ets} (100%) rename migrator/test/staticTS/CTS/03.types/01.primitive_types/03.float_types/{float_types_nan.sts => float_types_nan.ets} (100%) rename migrator/test/staticTS/CTS/03.types/01.primitive_types/04.char_type/{char_type.sts => char_type.ets} (100%) rename migrator/test/staticTS/CTS/03.types/01.primitive_types/05.boolean_type_and_operations/{boolean_type.sts => boolean_type.ets} (100%) rename migrator/test/staticTS/CTS/03.types/01.primitive_types/06.void_type/{void_type.sts => void_type.ets} (100%) rename migrator/test/staticTS/CTS/03.types/01.primitive_types/07.default_values_for_primitive_types/{default_value.sts => default_value.ets} (100%) rename migrator/test/staticTS/CTS/03.types/02.reference_types/02.named_types/{named_types.sts => named_types.ets} (100%) rename migrator/test/staticTS/CTS/03.types/02.reference_types/02.named_types/{named_types_generics.sts => named_types_generics.ets} (100%) rename migrator/test/staticTS/CTS/03.types/02.reference_types/04.the_object_class/{object_type.sts => object_type.ets} (100%) rename migrator/test/staticTS/CTS/03.types/02.reference_types/05.the_string_class/{string_type.sts => string_type.ets} (100%) create mode 100644 migrator/test/staticTS/CTS/03.types/02.reference_types/06.function_types/list.function_types.yaml rename migrator/test/staticTS/CTS/03.types/05.type_reference/{tbd.type_reference.sts => tbd.type_reference.ets} (100%) rename migrator/test/staticTS/CTS/04.names_declarations_and_scopes/01.names/{qualified_name.sts => qualified_name.ets} (100%) rename migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/{n.unique_block_decl.sts => n.unique_block_decl.ets} (100%) rename migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/{n.unique_class_decl.sts => n.unique_class_decl.ets} (100%) rename migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/{n.unique_decl_name.sts => n.unique_decl_name.ets} (100%) rename migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/{n.unique_enum_decl.sts => n.unique_enum_decl.ets} (100%) rename migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/{n.unique_func_decl.sts => n.unique_func_decl.ets} (100%) rename migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/{n.unique_intf_decl.sts => n.unique_intf_decl.ets} (100%) rename migrator/test/staticTS/CTS/04.names_declarations_and_scopes/03.scopes/{class_level.sts => class_level.ets} (100%) rename migrator/test/staticTS/CTS/04.names_declarations_and_scopes/03.scopes/{n.hoisting.sts => n.hoisting.ets} (100%) rename migrator/test/staticTS/CTS/04.names_declarations_and_scopes/03.scopes/{package_level.sts => package_level.ets} (100%) rename migrator/test/staticTS/CTS/04.names_declarations_and_scopes/03.scopes/{tbd.enum_level.sts => tbd.enum_level.ets} (100%) rename migrator/test/staticTS/CTS/04.names_declarations_and_scopes/03.scopes/{tbd.interface_level.sts => tbd.interface_level.ets} (100%) rename migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/01.variable_declarations/{n.var_decl.sts => n.var_decl.ets} (100%) rename migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/01.variable_declarations/{tbd.initialize_before_use.sts => tbd.initialize_before_use.ets} (100%) rename migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/01.variable_declarations/{var_decl.sts => var_decl.ets} (100%) rename migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/02.constant_declarations/{const_decl.sts => const_decl.ets} (100%) rename migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/02.constant_declarations/{n.const_decl.sts => n.const_decl.ets} (100%) rename migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/03.type_compatibility_with_initializer/{initializer_compatibility.sts => initializer_compatibility.ets} (100%) rename migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/04.type_inference_from_initializer/{n.null_initializer.sts => n.null_initializer.ets} (100%) rename migrator/test/staticTS/CTS/04.names_declarations_and_scopes/06.function_declarations/01.variadic_parameters/{fn_variadic.sts => fn_variadic.ets} (100%) rename migrator/test/staticTS/CTS/04.names_declarations_and_scopes/06.function_declarations/{function_decl.sts => function_decl.ets} (100%) rename migrator/test/staticTS/CTS/04.names_declarations_and_scopes/06.function_declarations/{n.nested_function.sts => n.nested_function.ets} (100%) rename migrator/test/staticTS/CTS/05.generic_and_parameterized_declarations/01.generic_declarations/01.generic_classes/{n.generic_class_self_dependency.sts => n.generic_class_self_dependency.ets} (100%) rename migrator/test/staticTS/CTS/05.generic_and_parameterized_declarations/01.generic_declarations/01.generic_classes/{n.generic_class_wrong_constraint.sts => n.generic_class_wrong_constraint.ets} (100%) rename migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/02.widening_primitive_conversion/{widening.sts => widening.ets} (100%) rename migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/07.boxing_conversion/{boxing_conversion.sts => boxing_conversion.ets} (100%) rename migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/07.boxing_conversion/{boxing_coversion_nan.sts => boxing_coversion_nan.ets} (100%) rename migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/08.unboxing_conversion/{unboxing_conversion.sts => unboxing_conversion.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/06.evaluation_order/03.evaluation_respects_parentheses_and_precedence/{int_parens.sts => int_parens.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/06.evaluation_order/04.arguments_lists_are_evaluated_left_to_right/{arg_order_function.sts => arg_order_function.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/08.class_literal/{class_literal.sts => class_literal.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/09.array_literal/{array_literal.sts => array_literal.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/10.parenthesized_expression/{paren_expr.sts => paren_expr.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/14.array_access_expression/{array_access.sts => array_access.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/15.function_invocation_expression/{function_invocation_expr.sts => function_invocation_expr.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/16.new_expression/01.class_instance_creation_expression/{class_instance.sts => class_instance.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/16.new_expression/02.array_creation_instance/{array_creation.sts => array_creation.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/17.unary_operators/01.postfix_increment_operator/{postfix_increment.sts => postfix_increment.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/17.unary_operators/02.postfix_decrement_operator/{postfix_decrement.sts => postfix_decrement.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/17.unary_operators/03.prefix_increment_operator/{prefix_increment.sts => prefix_increment.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/17.unary_operators/04.prefix_decrement_operator/{prefix_decrement.sts => prefix_decrement.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/17.unary_operators/05.unary_plus_operator/{unary_plus.sts => unary_plus.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/17.unary_operators/06.unary_minus_operator/{unary_minus_corner.sts => unary_minus_corner.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/17.unary_operators/06.unary_minus_operator/{unary_minus_inbound.sts => unary_minus_inbound.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/17.unary_operators/06.unary_minus_operator/{unary_minus_onbound.sts => unary_minus_onbound.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/17.unary_operators/07.bitwise_complement_operator/{bitwise_complement.sts => bitwise_complement.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/17.unary_operators/07.bitwise_complement_operator/{tbd.bitwise_long_int.sts => tbd.bitwise_long_int.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/17.unary_operators/08.logical_complement_operator/{logical_complement.sts => logical_complement.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/01.multiplication_operator/{integer_mul.sts => integer_mul.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/01.multiplication_operator/{nan_inf.sts => nan_inf.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/02.division_operator/{nan_inf.sts => nan_inf.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/02.division_operator/{tbd.float_div_overflow.sts => tbd.float_div_overflow.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/02.division_operator/{tbd.float_division.sts => tbd.float_division.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/02.division_operator/{tbd.int_div_overflow.sts => tbd.int_div_overflow.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/03.remainder_operator/{integer_remainder.sts => integer_remainder.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/03.remainder_operator/{nan_inf.sts => nan_inf.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/20.additive_operators/01.string_concatenation_operator/{string_concat.sts => string_concat.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/20.additive_operators/02.additive_operators_for_numeric_types/{nan_inf.sts => nan_inf.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/21.shift_operators/{n.shift_int.sts => n.shift_int.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/21.shift_operators/{rshift_int.sts => rshift_int.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/22.relational_operators/01.numerical_comparison_operators/{float_comparison.sts => float_comparison.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/22.relational_operators/01.numerical_comparison_operators/{integer_comparison.sts => integer_comparison.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/23.type_comparison_operator_instanceof/{instanceof.sts => instanceof.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/24.equality_operator/01.numerical_equality_operators/{float_equality_00.sts => float_equality_00.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/24.equality_operator/01.numerical_equality_operators/{float_equality_01.sts => float_equality_01.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/24.equality_operator/01.numerical_equality_operators/{float_equality_02.sts => float_equality_02.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/24.equality_operator/01.numerical_equality_operators/{float_equality_03.sts => float_equality_03.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/24.equality_operator/01.numerical_equality_operators/{float_equality_04.sts => float_equality_04.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/24.equality_operator/02.boolean_equality_operators/{boolean_eq.sts => boolean_eq.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/24.equality_operator/03.string_equality_operators/{string_eq.sts => string_eq.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/24.equality_operator/{general_equality_00.sts => general_equality_00.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/24.equality_operator/{general_equality_01.sts => general_equality_01.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/24.equality_operator/{general_equality_02.sts => general_equality_02.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/{integer_and.sts => integer_and.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/{integer_or.sts => integer_or.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/{integer_xor.sts => integer_xor.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/{tbd.large_size_operations.sts => tbd.large_size_operations.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/02.logical_bitwise_operators/{logical_bitwise_bool.sts => logical_bitwise_bool.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/02.logical_bitwise_operators/{logical_bitwise_boolean.sts => logical_bitwise_boolean.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/26.conditional_and_operator/{conditional_and_bool.sts => conditional_and_bool.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/26.conditional_and_operator/{conditional_and_boolean.sts => conditional_and_boolean.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/26.conditional_and_operator/{tbd.n.conditional_and_bool.sts => tbd.n.conditional_and_bool.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/27.conditional_or_operator/{conditional_or_bool.sts => conditional_or_bool.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/27.conditional_or_operator/{conditional_or_boolean.sts => conditional_or_boolean.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/27.conditional_or_operator/{tbd.n.conditional_or_bool.sts => tbd.n.conditional_or_bool.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/29.conditional_expressions/{conditional_expression_evaluation.sts => conditional_expression_evaluation.ets} (100%) rename migrator/test/staticTS/CTS/07.expressions/29.conditional_expressions/{conditional_expression_order.sts => conditional_expression_order.ets} (100%) rename migrator/test/staticTS/CTS/08.statements/01.expression_statement/{expression_statement.sts => expression_statement.ets} (100%) rename migrator/test/staticTS/CTS/08.statements/02.block/{block_statement.sts => block_statement.ets} (100%) rename migrator/test/staticTS/CTS/08.statements/03.labeled_statement/{labeled_statement.sts => labeled_statement.ets} (100%) rename migrator/test/staticTS/CTS/08.statements/04.local_declarations/{local_class.sts => local_class.ets} (100%) rename migrator/test/staticTS/CTS/08.statements/04.local_declarations/{local_const.sts => local_const.ets} (100%) rename migrator/test/staticTS/CTS/08.statements/04.local_declarations/{local_var.sts => local_var.ets} (100%) rename migrator/test/staticTS/CTS/08.statements/04.local_declarations/{n.local_class.sts => n.local_class.ets} (100%) rename migrator/test/staticTS/CTS/08.statements/04.local_declarations/{n.local_const.sts => n.local_const.ets} (100%) rename migrator/test/staticTS/CTS/08.statements/04.local_declarations/{n.local_var.sts => n.local_var.ets} (100%) rename migrator/test/staticTS/CTS/08.statements/05.if_statement/{if.sts => if.ets} (100%) rename migrator/test/staticTS/CTS/08.statements/05.if_statement/{if_not_executed.sts => if_not_executed.ets} (100%) rename migrator/test/staticTS/CTS/08.statements/05.if_statement/{nested_if.sts => nested_if.ets} (100%) rename migrator/test/staticTS/CTS/08.statements/06.while_and_do_statements/{do.sts => do.ets} (100%) rename migrator/test/staticTS/CTS/08.statements/06.while_and_do_statements/{while.sts => while.ets} (100%) rename migrator/test/staticTS/CTS/08.statements/06.while_and_do_statements/{while_not_executed.sts => while_not_executed.ets} (100%) rename migrator/test/staticTS/CTS/08.statements/07.for_statement/{for_existing.sts => for_existing.ets} (100%) rename migrator/test/staticTS/CTS/08.statements/07.for_statement/{for_new.sts => for_new.ets} (100%) rename migrator/test/staticTS/CTS/08.statements/07.for_statement/{for_new_implicit.sts => for_new_implicit.ets} (100%) rename migrator/test/staticTS/CTS/08.statements/08.for_of_statement/{for_of_new.sts => for_of_new.ets} (100%) rename migrator/test/staticTS/CTS/08.statements/08.for_of_statement/{for_of_new_type.sts => for_of_new_type.ets} (100%) rename migrator/test/staticTS/CTS/08.statements/09.break_statement/{break.sts => break.ets} (100%) rename migrator/test/staticTS/CTS/08.statements/10.continue_statement/{continue_while.sts => continue_while.ets} (100%) rename migrator/test/staticTS/CTS/08.statements/11.return_statement/{return.sts => return.ets} (100%) rename migrator/test/staticTS/CTS/08.statements/12.switch_statement/{n.switch_duplicate.sts => n.switch_duplicate.ets} (100%) rename migrator/test/staticTS/CTS/08.statements/12.switch_statement/{switch.sts => switch.ets} (100%) rename migrator/test/staticTS/CTS/08.statements/12.switch_statement/{switch_block.sts => switch_block.ets} (100%) rename migrator/test/staticTS/CTS/08.statements/12.switch_statement/{switch_char.sts => switch_char.ets} (100%) rename migrator/test/staticTS/CTS/08.statements/12.switch_statement/{switch_enum.sts => switch_enum.ets} (100%) rename migrator/test/staticTS/CTS/08.statements/13.assert_statement/{assert.sts => assert.ets} (100%) rename migrator/test/staticTS/CTS/08.statements/13.assert_statement/{ne.assert.sts => ne.assert.ets} (100%) rename migrator/test/staticTS/CTS/08.statements/13.assert_statement/{ne.assert_str.sts => ne.assert_str.ets} (100%) rename migrator/test/staticTS/CTS/08.statements/16.panic_statement/{ne.panic_statement.sts => ne.panic_statement.ets} (100%) rename migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/01.abstract_classes/{abstract.sts => abstract.ets} (100%) rename migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/01.abstract_classes/{abstract_method.sts => abstract_method.ets} (100%) rename migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/01.abstract_classes/{n.abstract_instantiate.sts => n.abstract_instantiate.ets} (100%) rename migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/01.abstract_classes/{n.abstract_method.sts => n.abstract_method.ets} (100%) rename migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/01.abstract_classes/{n.abstract_open.sts => n.abstract_open.ets} (100%) rename migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/02.open_classes/{n.open_class.sts => n.open_class.ets} (100%) rename migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/02.open_classes/{open_class.sts => open_class.ets} (100%) rename migrator/test/staticTS/CTS/09.classes/01.class_declaration/04.class_body/{class_members.sts => class_members.ets} (100%) rename migrator/test/staticTS/CTS/09.classes/01.class_declaration/04.class_body/{n.class_members.sts => n.class_members.ets} (100%) rename migrator/test/staticTS/CTS/09.classes/01.class_declaration/{point.sts => point.ets} (100%) rename migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/{empty_interface_declaration.sts => empty_interface_declaration.ets} (100%) rename migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/{empty_interface_declaration_with_type_params.sts => empty_interface_declaration_with_type_params.ets} (100%) rename migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/{interface_fields.sts => interface_fields.ets} (100%) rename migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/{interface_fields_without_types.sts => interface_fields_without_types.ets} (100%) rename migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/{n.interface_extends_without_type.sts => n.interface_extends_without_type.ets} (100%) rename migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/{several_interface_fields.sts => several_interface_fields.ets} (100%) rename migrator/test/staticTS/CTS/10.interfaces/05.interface_field_declarations/{interface_field_decl.sts => interface_field_decl.ets} (100%) rename migrator/test/staticTS/CTS/10.interfaces/06.interface_method_declaration/01.static_interface_methods/{n.static_interface_methods.sts => n.static_interface_methods.ets} (100%) rename migrator/test/staticTS/CTS/10.interfaces/06.interface_method_declaration/01.static_interface_methods/{static_interface_methods.sts => static_interface_methods.ets} (100%) rename migrator/test/staticTS/CTS/10.interfaces/06.interface_method_declaration/02.private_interface_methods/{n.private_interface_methods.sts => n.private_interface_methods.ets} (100%) rename migrator/test/staticTS/CTS/10.interfaces/06.interface_method_declaration/02.private_interface_methods/{n.private_interface_methods_static.sts => n.private_interface_methods_static.ets} (100%) rename migrator/test/staticTS/CTS/10.interfaces/06.interface_method_declaration/02.private_interface_methods/{private_interface_methods.sts => private_interface_methods.ets} (100%) rename migrator/test/staticTS/CTS/11.enums/01.enum_constants/{any_number_of_constants.sts => any_number_of_constants.ets} (100%) rename migrator/test/staticTS/CTS/11.enums/01.enum_constants/{n.empty_enum.sts => n.empty_enum.ets} (100%) rename migrator/test/staticTS/CTS/11.enums/01.enum_constants/{n.repeating_constants.sts => n.repeating_constants.ets} (100%) rename migrator/test/staticTS/CTS/11.enums/01.enum_constants/{n.trailing_comma_enum.sts => n.trailing_comma_enum.ets} (100%) rename migrator/test/staticTS/CTS/11.enums/01.enum_constants/{simple_enum.sts => simple_enum.ets} (100%) rename migrator/test/staticTS/CTS/11.enums/02.enum_type_methods/{enum_type_methods_valueof.sts => enum_type_methods_valueof.ets} (100%) rename migrator/test/staticTS/CTS/11.enums/02.enum_type_methods/{enum_type_methods_values.sts => enum_type_methods_values.ets} (100%) rename migrator/test/staticTS/CTS/11.enums/03.enum_constant_methods/{enum_constant_ordinals.sts => enum_constant_ordinals.ets} (100%) rename migrator/test/staticTS/CTS/11.enums/03.enum_constant_methods/{enum_constant_to_string.sts => enum_constant_to_string.ets} (100%) rename migrator/test/staticTS/CTS/13.packages/02.import_declarations/{import.sts => import.ets} (100%) rename migrator/test/staticTS/CTS/13.packages/02.import_declarations/{import_as.sts => import_as.ets} (100%) rename migrator/test/staticTS/CTS/13.packages/02.import_declarations/{n.import_all_as.sts => n.import_all_as.ets} (100%) rename migrator/test/staticTS/CTS/13.packages/05.export_declarations/{export_declarations.sts => export_declarations.ets} (100%) rename migrator/test/staticTS/CTS/13.packages/05.export_declarations/{n.exported_grouped_declarations.sts => n.exported_grouped_declarations.ets} (100%) rename migrator/test/staticTS/CTS/13.packages/06.program_entry_point/{multiple_entrypoints.sts => multiple_entrypoints.ets} (100%) diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/01.comments/multi_line_comment.sts b/migrator/test/staticTS/CTS/02.lexical_elements/01.comments/multi_line_comment.ets similarity index 100% rename from migrator/test/staticTS/CTS/02.lexical_elements/01.comments/multi_line_comment.sts rename to migrator/test/staticTS/CTS/02.lexical_elements/01.comments/multi_line_comment.ets diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/01.comments/one_line_comment.sts b/migrator/test/staticTS/CTS/02.lexical_elements/01.comments/one_line_comment.ets similarity index 100% rename from migrator/test/staticTS/CTS/02.lexical_elements/01.comments/one_line_comment.sts rename to migrator/test/staticTS/CTS/02.lexical_elements/01.comments/one_line_comment.ets diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/02.tokens/01.whitespaces/.gitattributes b/migrator/test/staticTS/CTS/02.lexical_elements/02.tokens/01.whitespaces/.gitattributes index 460fe17b8..818701a6c 100644 --- a/migrator/test/staticTS/CTS/02.lexical_elements/02.tokens/01.whitespaces/.gitattributes +++ b/migrator/test/staticTS/CTS/02.lexical_elements/02.tokens/01.whitespaces/.gitattributes @@ -1 +1 @@ -whitespaces.sts binary +whitespaces.ets binary diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/02.tokens/01.whitespaces/whitespaces.sts b/migrator/test/staticTS/CTS/02.lexical_elements/02.tokens/01.whitespaces/whitespaces.ets similarity index 100% rename from migrator/test/staticTS/CTS/02.lexical_elements/02.tokens/01.whitespaces/whitespaces.sts rename to migrator/test/staticTS/CTS/02.lexical_elements/02.tokens/01.whitespaces/whitespaces.ets diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/02.tokens/02.line_separators/.gitattributes b/migrator/test/staticTS/CTS/02.lexical_elements/02.tokens/02.line_separators/.gitattributes index c8e18f51d..fc4523d3a 100644 --- a/migrator/test/staticTS/CTS/02.lexical_elements/02.tokens/02.line_separators/.gitattributes +++ b/migrator/test/staticTS/CTS/02.lexical_elements/02.tokens/02.line_separators/.gitattributes @@ -1 +1 @@ -line_separators.sts binary +line_separators.ets binary diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/02.tokens/02.line_separators/line_separators.sts b/migrator/test/staticTS/CTS/02.lexical_elements/02.tokens/02.line_separators/line_separators.ets similarity index 100% rename from migrator/test/staticTS/CTS/02.lexical_elements/02.tokens/02.line_separators/line_separators.sts rename to migrator/test/staticTS/CTS/02.lexical_elements/02.tokens/02.line_separators/line_separators.ets diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/03.identifiers/identifiers.sts b/migrator/test/staticTS/CTS/02.lexical_elements/03.identifiers/identifiers.ets similarity index 100% rename from migrator/test/staticTS/CTS/02.lexical_elements/03.identifiers/identifiers.sts rename to migrator/test/staticTS/CTS/02.lexical_elements/03.identifiers/identifiers.ets diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/03.identifiers/identifiers_continue.sts b/migrator/test/staticTS/CTS/02.lexical_elements/03.identifiers/identifiers_continue.ets similarity index 100% rename from migrator/test/staticTS/CTS/02.lexical_elements/03.identifiers/identifiers_continue.sts rename to migrator/test/staticTS/CTS/02.lexical_elements/03.identifiers/identifiers_continue.ets diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/03.identifiers/identifiers_dollar.sts b/migrator/test/staticTS/CTS/02.lexical_elements/03.identifiers/identifiers_dollar.ets similarity index 100% rename from migrator/test/staticTS/CTS/02.lexical_elements/03.identifiers/identifiers_dollar.sts rename to migrator/test/staticTS/CTS/02.lexical_elements/03.identifiers/identifiers_dollar.ets diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/03.identifiers/identifiers_start.sts b/migrator/test/staticTS/CTS/02.lexical_elements/03.identifiers/identifiers_start.ets similarity index 100% rename from migrator/test/staticTS/CTS/02.lexical_elements/03.identifiers/identifiers_start.sts rename to migrator/test/staticTS/CTS/02.lexical_elements/03.identifiers/identifiers_start.ets diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/04.keywords/n.keywords.sts b/migrator/test/staticTS/CTS/02.lexical_elements/04.keywords/n.keywords.ets similarity index 100% rename from migrator/test/staticTS/CTS/02.lexical_elements/04.keywords/n.keywords.sts rename to migrator/test/staticTS/CTS/02.lexical_elements/04.keywords/n.keywords.ets diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/04.keywords/n.types.sts b/migrator/test/staticTS/CTS/02.lexical_elements/04.keywords/n.types.ets similarity index 100% rename from migrator/test/staticTS/CTS/02.lexical_elements/04.keywords/n.types.sts rename to migrator/test/staticTS/CTS/02.lexical_elements/04.keywords/n.types.ets diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/05.operators_and_punctuation/tbd.sts b/migrator/test/staticTS/CTS/02.lexical_elements/05.operators_and_punctuation/tbd.ets similarity index 100% rename from migrator/test/staticTS/CTS/02.lexical_elements/05.operators_and_punctuation/tbd.sts rename to migrator/test/staticTS/CTS/02.lexical_elements/05.operators_and_punctuation/tbd.ets diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/01.integer_literals/int_literals.sts b/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/01.integer_literals/int_literals.ets similarity index 100% rename from migrator/test/staticTS/CTS/02.lexical_elements/06.literals/01.integer_literals/int_literals.sts rename to migrator/test/staticTS/CTS/02.lexical_elements/06.literals/01.integer_literals/int_literals.ets diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/01.integer_literals/n.bad_int_literals.sts b/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/01.integer_literals/n.bad_int_literals.ets similarity index 100% rename from migrator/test/staticTS/CTS/02.lexical_elements/06.literals/01.integer_literals/n.bad_int_literals.sts rename to migrator/test/staticTS/CTS/02.lexical_elements/06.literals/01.integer_literals/n.bad_int_literals.ets diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/02.floating_point_literals/float_literals.sts b/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/02.floating_point_literals/float_literals.ets similarity index 100% rename from migrator/test/staticTS/CTS/02.lexical_elements/06.literals/02.floating_point_literals/float_literals.sts rename to migrator/test/staticTS/CTS/02.lexical_elements/06.literals/02.floating_point_literals/float_literals.ets diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/03.boolean_literals/boolean_literals.sts b/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/03.boolean_literals/boolean_literals.ets similarity index 100% rename from migrator/test/staticTS/CTS/02.lexical_elements/06.literals/03.boolean_literals/boolean_literals.sts rename to migrator/test/staticTS/CTS/02.lexical_elements/06.literals/03.boolean_literals/boolean_literals.ets diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/04.string_literals/string_literals.sts b/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/04.string_literals/string_literals.ets similarity index 100% rename from migrator/test/staticTS/CTS/02.lexical_elements/06.literals/04.string_literals/string_literals.sts rename to migrator/test/staticTS/CTS/02.lexical_elements/06.literals/04.string_literals/string_literals.ets diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/04.string_literals/tbd.multiline_string_literals.sts b/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/04.string_literals/tbd.multiline_string_literals.ets similarity index 100% rename from migrator/test/staticTS/CTS/02.lexical_elements/06.literals/04.string_literals/tbd.multiline_string_literals.sts rename to migrator/test/staticTS/CTS/02.lexical_elements/06.literals/04.string_literals/tbd.multiline_string_literals.ets diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/04.string_literals/tbd.string_literals_escapes_n_continuation.sts b/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/04.string_literals/tbd.string_literals_escapes_n_continuation.ets similarity index 100% rename from migrator/test/staticTS/CTS/02.lexical_elements/06.literals/04.string_literals/tbd.string_literals_escapes_n_continuation.sts rename to migrator/test/staticTS/CTS/02.lexical_elements/06.literals/04.string_literals/tbd.string_literals_escapes_n_continuation.ets diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/05.char_literals/char_literals.sts b/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/05.char_literals/char_literals.ets similarity index 100% rename from migrator/test/staticTS/CTS/02.lexical_elements/06.literals/05.char_literals/char_literals.sts rename to migrator/test/staticTS/CTS/02.lexical_elements/06.literals/05.char_literals/char_literals.ets diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/06.null_literals/null_literal.sts b/migrator/test/staticTS/CTS/02.lexical_elements/06.literals/06.null_literals/null_literal.ets similarity index 100% rename from migrator/test/staticTS/CTS/02.lexical_elements/06.literals/06.null_literals/null_literal.sts rename to migrator/test/staticTS/CTS/02.lexical_elements/06.literals/06.null_literals/null_literal.ets diff --git a/migrator/test/staticTS/CTS/02.lexical_elements/07.automatic_semicolon_insertion/tbd.automatic_semicolon_insertion.sts b/migrator/test/staticTS/CTS/02.lexical_elements/07.automatic_semicolon_insertion/tbd.automatic_semicolon_insertion.ets similarity index 100% rename from migrator/test/staticTS/CTS/02.lexical_elements/07.automatic_semicolon_insertion/tbd.automatic_semicolon_insertion.sts rename to migrator/test/staticTS/CTS/02.lexical_elements/07.automatic_semicolon_insertion/tbd.automatic_semicolon_insertion.ets diff --git a/migrator/test/staticTS/CTS/03.types/01.primitive_types/01.integer_type/integer_types.sts b/migrator/test/staticTS/CTS/03.types/01.primitive_types/01.integer_type/integer_types.ets similarity index 100% rename from migrator/test/staticTS/CTS/03.types/01.primitive_types/01.integer_type/integer_types.sts rename to migrator/test/staticTS/CTS/03.types/01.primitive_types/01.integer_type/integer_types.ets diff --git a/migrator/test/staticTS/CTS/03.types/01.primitive_types/03.float_types/float_types.sts b/migrator/test/staticTS/CTS/03.types/01.primitive_types/03.float_types/float_types.ets similarity index 100% rename from migrator/test/staticTS/CTS/03.types/01.primitive_types/03.float_types/float_types.sts rename to migrator/test/staticTS/CTS/03.types/01.primitive_types/03.float_types/float_types.ets diff --git a/migrator/test/staticTS/CTS/03.types/01.primitive_types/03.float_types/float_types_nan.sts b/migrator/test/staticTS/CTS/03.types/01.primitive_types/03.float_types/float_types_nan.ets similarity index 100% rename from migrator/test/staticTS/CTS/03.types/01.primitive_types/03.float_types/float_types_nan.sts rename to migrator/test/staticTS/CTS/03.types/01.primitive_types/03.float_types/float_types_nan.ets diff --git a/migrator/test/staticTS/CTS/03.types/01.primitive_types/04.char_type/char_type.sts b/migrator/test/staticTS/CTS/03.types/01.primitive_types/04.char_type/char_type.ets similarity index 100% rename from migrator/test/staticTS/CTS/03.types/01.primitive_types/04.char_type/char_type.sts rename to migrator/test/staticTS/CTS/03.types/01.primitive_types/04.char_type/char_type.ets diff --git a/migrator/test/staticTS/CTS/03.types/01.primitive_types/05.boolean_type_and_operations/boolean_type.sts b/migrator/test/staticTS/CTS/03.types/01.primitive_types/05.boolean_type_and_operations/boolean_type.ets similarity index 100% rename from migrator/test/staticTS/CTS/03.types/01.primitive_types/05.boolean_type_and_operations/boolean_type.sts rename to migrator/test/staticTS/CTS/03.types/01.primitive_types/05.boolean_type_and_operations/boolean_type.ets diff --git a/migrator/test/staticTS/CTS/03.types/01.primitive_types/06.void_type/void_type.sts b/migrator/test/staticTS/CTS/03.types/01.primitive_types/06.void_type/void_type.ets similarity index 100% rename from migrator/test/staticTS/CTS/03.types/01.primitive_types/06.void_type/void_type.sts rename to migrator/test/staticTS/CTS/03.types/01.primitive_types/06.void_type/void_type.ets diff --git a/migrator/test/staticTS/CTS/03.types/01.primitive_types/07.default_values_for_primitive_types/default_value.sts b/migrator/test/staticTS/CTS/03.types/01.primitive_types/07.default_values_for_primitive_types/default_value.ets similarity index 100% rename from migrator/test/staticTS/CTS/03.types/01.primitive_types/07.default_values_for_primitive_types/default_value.sts rename to migrator/test/staticTS/CTS/03.types/01.primitive_types/07.default_values_for_primitive_types/default_value.ets diff --git a/migrator/test/staticTS/CTS/03.types/02.reference_types/02.named_types/named_types.sts b/migrator/test/staticTS/CTS/03.types/02.reference_types/02.named_types/named_types.ets similarity index 100% rename from migrator/test/staticTS/CTS/03.types/02.reference_types/02.named_types/named_types.sts rename to migrator/test/staticTS/CTS/03.types/02.reference_types/02.named_types/named_types.ets diff --git a/migrator/test/staticTS/CTS/03.types/02.reference_types/02.named_types/named_types_generics.sts b/migrator/test/staticTS/CTS/03.types/02.reference_types/02.named_types/named_types_generics.ets similarity index 100% rename from migrator/test/staticTS/CTS/03.types/02.reference_types/02.named_types/named_types_generics.sts rename to migrator/test/staticTS/CTS/03.types/02.reference_types/02.named_types/named_types_generics.ets diff --git a/migrator/test/staticTS/CTS/03.types/02.reference_types/04.the_object_class/object_type.sts b/migrator/test/staticTS/CTS/03.types/02.reference_types/04.the_object_class/object_type.ets similarity index 100% rename from migrator/test/staticTS/CTS/03.types/02.reference_types/04.the_object_class/object_type.sts rename to migrator/test/staticTS/CTS/03.types/02.reference_types/04.the_object_class/object_type.ets diff --git a/migrator/test/staticTS/CTS/03.types/02.reference_types/05.the_string_class/string_type.sts b/migrator/test/staticTS/CTS/03.types/02.reference_types/05.the_string_class/string_type.ets similarity index 100% rename from migrator/test/staticTS/CTS/03.types/02.reference_types/05.the_string_class/string_type.sts rename to migrator/test/staticTS/CTS/03.types/02.reference_types/05.the_string_class/string_type.ets diff --git a/migrator/test/staticTS/CTS/03.types/02.reference_types/06.function_types/list.function_types.yaml b/migrator/test/staticTS/CTS/03.types/02.reference_types/06.function_types/list.function_types.yaml new file mode 100644 index 000000000..b7806af43 --- /dev/null +++ b/migrator/test/staticTS/CTS/03.types/02.reference_types/06.function_types/list.function_types.yaml @@ -0,0 +1,5 @@ +--- # List of valid function types + +- "(): void" +- "(int): void" + diff --git a/migrator/test/staticTS/CTS/03.types/05.type_reference/tbd.type_reference.sts b/migrator/test/staticTS/CTS/03.types/05.type_reference/tbd.type_reference.ets similarity index 100% rename from migrator/test/staticTS/CTS/03.types/05.type_reference/tbd.type_reference.sts rename to migrator/test/staticTS/CTS/03.types/05.type_reference/tbd.type_reference.ets diff --git a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/01.names/qualified_name.sts b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/01.names/qualified_name.ets similarity index 100% rename from migrator/test/staticTS/CTS/04.names_declarations_and_scopes/01.names/qualified_name.sts rename to migrator/test/staticTS/CTS/04.names_declarations_and_scopes/01.names/qualified_name.ets diff --git a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/n.unique_block_decl.sts b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/n.unique_block_decl.ets similarity index 100% rename from migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/n.unique_block_decl.sts rename to migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/n.unique_block_decl.ets diff --git a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/n.unique_class_decl.sts b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/n.unique_class_decl.ets similarity index 100% rename from migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/n.unique_class_decl.sts rename to migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/n.unique_class_decl.ets diff --git a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/n.unique_decl_name.sts b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/n.unique_decl_name.ets similarity index 100% rename from migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/n.unique_decl_name.sts rename to migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/n.unique_decl_name.ets diff --git a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/n.unique_enum_decl.sts b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/n.unique_enum_decl.ets similarity index 100% rename from migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/n.unique_enum_decl.sts rename to migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/n.unique_enum_decl.ets diff --git a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/n.unique_func_decl.sts b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/n.unique_func_decl.ets similarity index 100% rename from migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/n.unique_func_decl.sts rename to migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/n.unique_func_decl.ets diff --git a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/n.unique_intf_decl.sts b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/n.unique_intf_decl.ets similarity index 100% rename from migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/n.unique_intf_decl.sts rename to migrator/test/staticTS/CTS/04.names_declarations_and_scopes/02.declarations/n.unique_intf_decl.ets diff --git a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/03.scopes/class_level.sts b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/03.scopes/class_level.ets similarity index 100% rename from migrator/test/staticTS/CTS/04.names_declarations_and_scopes/03.scopes/class_level.sts rename to migrator/test/staticTS/CTS/04.names_declarations_and_scopes/03.scopes/class_level.ets diff --git a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/03.scopes/n.hoisting.sts b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/03.scopes/n.hoisting.ets similarity index 100% rename from migrator/test/staticTS/CTS/04.names_declarations_and_scopes/03.scopes/n.hoisting.sts rename to migrator/test/staticTS/CTS/04.names_declarations_and_scopes/03.scopes/n.hoisting.ets diff --git a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/03.scopes/package_level.sts b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/03.scopes/package_level.ets similarity index 100% rename from migrator/test/staticTS/CTS/04.names_declarations_and_scopes/03.scopes/package_level.sts rename to migrator/test/staticTS/CTS/04.names_declarations_and_scopes/03.scopes/package_level.ets diff --git a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/03.scopes/tbd.enum_level.sts b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/03.scopes/tbd.enum_level.ets similarity index 100% rename from migrator/test/staticTS/CTS/04.names_declarations_and_scopes/03.scopes/tbd.enum_level.sts rename to migrator/test/staticTS/CTS/04.names_declarations_and_scopes/03.scopes/tbd.enum_level.ets diff --git a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/03.scopes/tbd.interface_level.sts b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/03.scopes/tbd.interface_level.ets similarity index 100% rename from migrator/test/staticTS/CTS/04.names_declarations_and_scopes/03.scopes/tbd.interface_level.sts rename to migrator/test/staticTS/CTS/04.names_declarations_and_scopes/03.scopes/tbd.interface_level.ets diff --git a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/01.variable_declarations/n.var_decl.sts b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/01.variable_declarations/n.var_decl.ets similarity index 100% rename from migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/01.variable_declarations/n.var_decl.sts rename to migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/01.variable_declarations/n.var_decl.ets diff --git a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/01.variable_declarations/tbd.initialize_before_use.sts b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/01.variable_declarations/tbd.initialize_before_use.ets similarity index 100% rename from migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/01.variable_declarations/tbd.initialize_before_use.sts rename to migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/01.variable_declarations/tbd.initialize_before_use.ets diff --git a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/01.variable_declarations/var_decl.sts b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/01.variable_declarations/var_decl.ets similarity index 100% rename from migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/01.variable_declarations/var_decl.sts rename to migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/01.variable_declarations/var_decl.ets diff --git a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/02.constant_declarations/const_decl.sts b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/02.constant_declarations/const_decl.ets similarity index 100% rename from migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/02.constant_declarations/const_decl.sts rename to migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/02.constant_declarations/const_decl.ets diff --git a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/02.constant_declarations/n.const_decl.sts b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/02.constant_declarations/n.const_decl.ets similarity index 100% rename from migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/02.constant_declarations/n.const_decl.sts rename to migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/02.constant_declarations/n.const_decl.ets diff --git a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/03.type_compatibility_with_initializer/initializer_compatibility.sts b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/03.type_compatibility_with_initializer/initializer_compatibility.ets similarity index 100% rename from migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/03.type_compatibility_with_initializer/initializer_compatibility.sts rename to migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/03.type_compatibility_with_initializer/initializer_compatibility.ets diff --git a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/04.type_inference_from_initializer/n.null_initializer.sts b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/04.type_inference_from_initializer/n.null_initializer.ets similarity index 100% rename from migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/04.type_inference_from_initializer/n.null_initializer.sts rename to migrator/test/staticTS/CTS/04.names_declarations_and_scopes/05.variable_and_constant_declarations/04.type_inference_from_initializer/n.null_initializer.ets diff --git a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/06.function_declarations/01.variadic_parameters/fn_variadic.sts b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/06.function_declarations/01.variadic_parameters/fn_variadic.ets similarity index 100% rename from migrator/test/staticTS/CTS/04.names_declarations_and_scopes/06.function_declarations/01.variadic_parameters/fn_variadic.sts rename to migrator/test/staticTS/CTS/04.names_declarations_and_scopes/06.function_declarations/01.variadic_parameters/fn_variadic.ets diff --git a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/06.function_declarations/function_decl.sts b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/06.function_declarations/function_decl.ets similarity index 100% rename from migrator/test/staticTS/CTS/04.names_declarations_and_scopes/06.function_declarations/function_decl.sts rename to migrator/test/staticTS/CTS/04.names_declarations_and_scopes/06.function_declarations/function_decl.ets diff --git a/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/06.function_declarations/n.nested_function.sts b/migrator/test/staticTS/CTS/04.names_declarations_and_scopes/06.function_declarations/n.nested_function.ets similarity index 100% rename from migrator/test/staticTS/CTS/04.names_declarations_and_scopes/06.function_declarations/n.nested_function.sts rename to migrator/test/staticTS/CTS/04.names_declarations_and_scopes/06.function_declarations/n.nested_function.ets diff --git a/migrator/test/staticTS/CTS/05.generic_and_parameterized_declarations/01.generic_declarations/01.generic_classes/n.generic_class_self_dependency.sts b/migrator/test/staticTS/CTS/05.generic_and_parameterized_declarations/01.generic_declarations/01.generic_classes/n.generic_class_self_dependency.ets similarity index 100% rename from migrator/test/staticTS/CTS/05.generic_and_parameterized_declarations/01.generic_declarations/01.generic_classes/n.generic_class_self_dependency.sts rename to migrator/test/staticTS/CTS/05.generic_and_parameterized_declarations/01.generic_declarations/01.generic_classes/n.generic_class_self_dependency.ets diff --git a/migrator/test/staticTS/CTS/05.generic_and_parameterized_declarations/01.generic_declarations/01.generic_classes/n.generic_class_wrong_constraint.sts b/migrator/test/staticTS/CTS/05.generic_and_parameterized_declarations/01.generic_declarations/01.generic_classes/n.generic_class_wrong_constraint.ets similarity index 100% rename from migrator/test/staticTS/CTS/05.generic_and_parameterized_declarations/01.generic_declarations/01.generic_classes/n.generic_class_wrong_constraint.sts rename to migrator/test/staticTS/CTS/05.generic_and_parameterized_declarations/01.generic_declarations/01.generic_classes/n.generic_class_wrong_constraint.ets diff --git a/migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/02.widening_primitive_conversion/widening.sts b/migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/02.widening_primitive_conversion/widening.ets similarity index 100% rename from migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/02.widening_primitive_conversion/widening.sts rename to migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/02.widening_primitive_conversion/widening.ets diff --git a/migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/07.boxing_conversion/boxing_conversion.sts b/migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/07.boxing_conversion/boxing_conversion.ets similarity index 100% rename from migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/07.boxing_conversion/boxing_conversion.sts rename to migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/07.boxing_conversion/boxing_conversion.ets diff --git a/migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/07.boxing_conversion/boxing_coversion_nan.sts b/migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/07.boxing_conversion/boxing_coversion_nan.ets similarity index 100% rename from migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/07.boxing_conversion/boxing_coversion_nan.sts rename to migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/07.boxing_conversion/boxing_coversion_nan.ets diff --git a/migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/08.unboxing_conversion/unboxing_conversion.sts b/migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/08.unboxing_conversion/unboxing_conversion.ets similarity index 100% rename from migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/08.unboxing_conversion/unboxing_conversion.sts rename to migrator/test/staticTS/CTS/06.conversions_and_contexts/01.kinds_of_conversion/08.unboxing_conversion/unboxing_conversion.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/06.evaluation_order/03.evaluation_respects_parentheses_and_precedence/int_parens.sts b/migrator/test/staticTS/CTS/07.expressions/06.evaluation_order/03.evaluation_respects_parentheses_and_precedence/int_parens.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/06.evaluation_order/03.evaluation_respects_parentheses_and_precedence/int_parens.sts rename to migrator/test/staticTS/CTS/07.expressions/06.evaluation_order/03.evaluation_respects_parentheses_and_precedence/int_parens.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/06.evaluation_order/04.arguments_lists_are_evaluated_left_to_right/arg_order_function.sts b/migrator/test/staticTS/CTS/07.expressions/06.evaluation_order/04.arguments_lists_are_evaluated_left_to_right/arg_order_function.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/06.evaluation_order/04.arguments_lists_are_evaluated_left_to_right/arg_order_function.sts rename to migrator/test/staticTS/CTS/07.expressions/06.evaluation_order/04.arguments_lists_are_evaluated_left_to_right/arg_order_function.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/08.class_literal/class_literal.sts b/migrator/test/staticTS/CTS/07.expressions/08.class_literal/class_literal.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/08.class_literal/class_literal.sts rename to migrator/test/staticTS/CTS/07.expressions/08.class_literal/class_literal.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/09.array_literal/array_literal.sts b/migrator/test/staticTS/CTS/07.expressions/09.array_literal/array_literal.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/09.array_literal/array_literal.sts rename to migrator/test/staticTS/CTS/07.expressions/09.array_literal/array_literal.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/10.parenthesized_expression/paren_expr.sts b/migrator/test/staticTS/CTS/07.expressions/10.parenthesized_expression/paren_expr.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/10.parenthesized_expression/paren_expr.sts rename to migrator/test/staticTS/CTS/07.expressions/10.parenthesized_expression/paren_expr.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/14.array_access_expression/array_access.sts b/migrator/test/staticTS/CTS/07.expressions/14.array_access_expression/array_access.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/14.array_access_expression/array_access.sts rename to migrator/test/staticTS/CTS/07.expressions/14.array_access_expression/array_access.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/15.function_invocation_expression/function_invocation_expr.sts b/migrator/test/staticTS/CTS/07.expressions/15.function_invocation_expression/function_invocation_expr.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/15.function_invocation_expression/function_invocation_expr.sts rename to migrator/test/staticTS/CTS/07.expressions/15.function_invocation_expression/function_invocation_expr.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/16.new_expression/01.class_instance_creation_expression/class_instance.sts b/migrator/test/staticTS/CTS/07.expressions/16.new_expression/01.class_instance_creation_expression/class_instance.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/16.new_expression/01.class_instance_creation_expression/class_instance.sts rename to migrator/test/staticTS/CTS/07.expressions/16.new_expression/01.class_instance_creation_expression/class_instance.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/16.new_expression/02.array_creation_instance/array_creation.sts b/migrator/test/staticTS/CTS/07.expressions/16.new_expression/02.array_creation_instance/array_creation.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/16.new_expression/02.array_creation_instance/array_creation.sts rename to migrator/test/staticTS/CTS/07.expressions/16.new_expression/02.array_creation_instance/array_creation.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/01.postfix_increment_operator/postfix_increment.sts b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/01.postfix_increment_operator/postfix_increment.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/17.unary_operators/01.postfix_increment_operator/postfix_increment.sts rename to migrator/test/staticTS/CTS/07.expressions/17.unary_operators/01.postfix_increment_operator/postfix_increment.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/02.postfix_decrement_operator/postfix_decrement.sts b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/02.postfix_decrement_operator/postfix_decrement.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/17.unary_operators/02.postfix_decrement_operator/postfix_decrement.sts rename to migrator/test/staticTS/CTS/07.expressions/17.unary_operators/02.postfix_decrement_operator/postfix_decrement.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/03.prefix_increment_operator/prefix_increment.sts b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/03.prefix_increment_operator/prefix_increment.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/17.unary_operators/03.prefix_increment_operator/prefix_increment.sts rename to migrator/test/staticTS/CTS/07.expressions/17.unary_operators/03.prefix_increment_operator/prefix_increment.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/04.prefix_decrement_operator/prefix_decrement.sts b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/04.prefix_decrement_operator/prefix_decrement.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/17.unary_operators/04.prefix_decrement_operator/prefix_decrement.sts rename to migrator/test/staticTS/CTS/07.expressions/17.unary_operators/04.prefix_decrement_operator/prefix_decrement.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/05.unary_plus_operator/unary_plus.sts b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/05.unary_plus_operator/unary_plus.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/17.unary_operators/05.unary_plus_operator/unary_plus.sts rename to migrator/test/staticTS/CTS/07.expressions/17.unary_operators/05.unary_plus_operator/unary_plus.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/06.unary_minus_operator/unary_minus_corner.sts b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/06.unary_minus_operator/unary_minus_corner.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/17.unary_operators/06.unary_minus_operator/unary_minus_corner.sts rename to migrator/test/staticTS/CTS/07.expressions/17.unary_operators/06.unary_minus_operator/unary_minus_corner.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/06.unary_minus_operator/unary_minus_inbound.sts b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/06.unary_minus_operator/unary_minus_inbound.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/17.unary_operators/06.unary_minus_operator/unary_minus_inbound.sts rename to migrator/test/staticTS/CTS/07.expressions/17.unary_operators/06.unary_minus_operator/unary_minus_inbound.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/06.unary_minus_operator/unary_minus_onbound.sts b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/06.unary_minus_operator/unary_minus_onbound.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/17.unary_operators/06.unary_minus_operator/unary_minus_onbound.sts rename to migrator/test/staticTS/CTS/07.expressions/17.unary_operators/06.unary_minus_operator/unary_minus_onbound.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/07.bitwise_complement_operator/bitwise_complement.sts b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/07.bitwise_complement_operator/bitwise_complement.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/17.unary_operators/07.bitwise_complement_operator/bitwise_complement.sts rename to migrator/test/staticTS/CTS/07.expressions/17.unary_operators/07.bitwise_complement_operator/bitwise_complement.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/07.bitwise_complement_operator/tbd.bitwise_long_int.sts b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/07.bitwise_complement_operator/tbd.bitwise_long_int.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/17.unary_operators/07.bitwise_complement_operator/tbd.bitwise_long_int.sts rename to migrator/test/staticTS/CTS/07.expressions/17.unary_operators/07.bitwise_complement_operator/tbd.bitwise_long_int.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/08.logical_complement_operator/logical_complement.sts b/migrator/test/staticTS/CTS/07.expressions/17.unary_operators/08.logical_complement_operator/logical_complement.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/17.unary_operators/08.logical_complement_operator/logical_complement.sts rename to migrator/test/staticTS/CTS/07.expressions/17.unary_operators/08.logical_complement_operator/logical_complement.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/01.multiplication_operator/integer_mul.sts b/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/01.multiplication_operator/integer_mul.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/01.multiplication_operator/integer_mul.sts rename to migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/01.multiplication_operator/integer_mul.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/01.multiplication_operator/nan_inf.sts b/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/01.multiplication_operator/nan_inf.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/01.multiplication_operator/nan_inf.sts rename to migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/01.multiplication_operator/nan_inf.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/02.division_operator/nan_inf.sts b/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/02.division_operator/nan_inf.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/02.division_operator/nan_inf.sts rename to migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/02.division_operator/nan_inf.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/02.division_operator/tbd.float_div_overflow.sts b/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/02.division_operator/tbd.float_div_overflow.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/02.division_operator/tbd.float_div_overflow.sts rename to migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/02.division_operator/tbd.float_div_overflow.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/02.division_operator/tbd.float_division.sts b/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/02.division_operator/tbd.float_division.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/02.division_operator/tbd.float_division.sts rename to migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/02.division_operator/tbd.float_division.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/02.division_operator/tbd.int_div_overflow.sts b/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/02.division_operator/tbd.int_div_overflow.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/02.division_operator/tbd.int_div_overflow.sts rename to migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/02.division_operator/tbd.int_div_overflow.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/03.remainder_operator/integer_remainder.sts b/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/03.remainder_operator/integer_remainder.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/03.remainder_operator/integer_remainder.sts rename to migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/03.remainder_operator/integer_remainder.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/03.remainder_operator/nan_inf.sts b/migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/03.remainder_operator/nan_inf.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/03.remainder_operator/nan_inf.sts rename to migrator/test/staticTS/CTS/07.expressions/19.multiplicative_operators/03.remainder_operator/nan_inf.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/20.additive_operators/01.string_concatenation_operator/string_concat.sts b/migrator/test/staticTS/CTS/07.expressions/20.additive_operators/01.string_concatenation_operator/string_concat.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/20.additive_operators/01.string_concatenation_operator/string_concat.sts rename to migrator/test/staticTS/CTS/07.expressions/20.additive_operators/01.string_concatenation_operator/string_concat.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/20.additive_operators/02.additive_operators_for_numeric_types/nan_inf.sts b/migrator/test/staticTS/CTS/07.expressions/20.additive_operators/02.additive_operators_for_numeric_types/nan_inf.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/20.additive_operators/02.additive_operators_for_numeric_types/nan_inf.sts rename to migrator/test/staticTS/CTS/07.expressions/20.additive_operators/02.additive_operators_for_numeric_types/nan_inf.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/21.shift_operators/n.shift_int.sts b/migrator/test/staticTS/CTS/07.expressions/21.shift_operators/n.shift_int.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/21.shift_operators/n.shift_int.sts rename to migrator/test/staticTS/CTS/07.expressions/21.shift_operators/n.shift_int.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/21.shift_operators/rshift_int.sts b/migrator/test/staticTS/CTS/07.expressions/21.shift_operators/rshift_int.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/21.shift_operators/rshift_int.sts rename to migrator/test/staticTS/CTS/07.expressions/21.shift_operators/rshift_int.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/22.relational_operators/01.numerical_comparison_operators/float_comparison.sts b/migrator/test/staticTS/CTS/07.expressions/22.relational_operators/01.numerical_comparison_operators/float_comparison.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/22.relational_operators/01.numerical_comparison_operators/float_comparison.sts rename to migrator/test/staticTS/CTS/07.expressions/22.relational_operators/01.numerical_comparison_operators/float_comparison.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/22.relational_operators/01.numerical_comparison_operators/integer_comparison.sts b/migrator/test/staticTS/CTS/07.expressions/22.relational_operators/01.numerical_comparison_operators/integer_comparison.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/22.relational_operators/01.numerical_comparison_operators/integer_comparison.sts rename to migrator/test/staticTS/CTS/07.expressions/22.relational_operators/01.numerical_comparison_operators/integer_comparison.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/23.type_comparison_operator_instanceof/instanceof.sts b/migrator/test/staticTS/CTS/07.expressions/23.type_comparison_operator_instanceof/instanceof.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/23.type_comparison_operator_instanceof/instanceof.sts rename to migrator/test/staticTS/CTS/07.expressions/23.type_comparison_operator_instanceof/instanceof.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/01.numerical_equality_operators/float_equality_00.sts b/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/01.numerical_equality_operators/float_equality_00.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/24.equality_operator/01.numerical_equality_operators/float_equality_00.sts rename to migrator/test/staticTS/CTS/07.expressions/24.equality_operator/01.numerical_equality_operators/float_equality_00.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/01.numerical_equality_operators/float_equality_01.sts b/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/01.numerical_equality_operators/float_equality_01.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/24.equality_operator/01.numerical_equality_operators/float_equality_01.sts rename to migrator/test/staticTS/CTS/07.expressions/24.equality_operator/01.numerical_equality_operators/float_equality_01.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/01.numerical_equality_operators/float_equality_02.sts b/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/01.numerical_equality_operators/float_equality_02.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/24.equality_operator/01.numerical_equality_operators/float_equality_02.sts rename to migrator/test/staticTS/CTS/07.expressions/24.equality_operator/01.numerical_equality_operators/float_equality_02.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/01.numerical_equality_operators/float_equality_03.sts b/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/01.numerical_equality_operators/float_equality_03.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/24.equality_operator/01.numerical_equality_operators/float_equality_03.sts rename to migrator/test/staticTS/CTS/07.expressions/24.equality_operator/01.numerical_equality_operators/float_equality_03.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/01.numerical_equality_operators/float_equality_04.sts b/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/01.numerical_equality_operators/float_equality_04.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/24.equality_operator/01.numerical_equality_operators/float_equality_04.sts rename to migrator/test/staticTS/CTS/07.expressions/24.equality_operator/01.numerical_equality_operators/float_equality_04.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/02.boolean_equality_operators/boolean_eq.sts b/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/02.boolean_equality_operators/boolean_eq.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/24.equality_operator/02.boolean_equality_operators/boolean_eq.sts rename to migrator/test/staticTS/CTS/07.expressions/24.equality_operator/02.boolean_equality_operators/boolean_eq.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/03.string_equality_operators/string_eq.sts b/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/03.string_equality_operators/string_eq.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/24.equality_operator/03.string_equality_operators/string_eq.sts rename to migrator/test/staticTS/CTS/07.expressions/24.equality_operator/03.string_equality_operators/string_eq.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/general_equality_00.sts b/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/general_equality_00.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/24.equality_operator/general_equality_00.sts rename to migrator/test/staticTS/CTS/07.expressions/24.equality_operator/general_equality_00.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/general_equality_01.sts b/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/general_equality_01.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/24.equality_operator/general_equality_01.sts rename to migrator/test/staticTS/CTS/07.expressions/24.equality_operator/general_equality_01.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/general_equality_02.sts b/migrator/test/staticTS/CTS/07.expressions/24.equality_operator/general_equality_02.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/24.equality_operator/general_equality_02.sts rename to migrator/test/staticTS/CTS/07.expressions/24.equality_operator/general_equality_02.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/integer_and.sts b/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/integer_and.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/integer_and.sts rename to migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/integer_and.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/integer_or.sts b/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/integer_or.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/integer_or.sts rename to migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/integer_or.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/integer_xor.sts b/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/integer_xor.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/integer_xor.sts rename to migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/integer_xor.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/tbd.large_size_operations.sts b/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/tbd.large_size_operations.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/tbd.large_size_operations.sts rename to migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/01.integer_bitwise_operators/tbd.large_size_operations.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/02.logical_bitwise_operators/logical_bitwise_bool.sts b/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/02.logical_bitwise_operators/logical_bitwise_bool.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/02.logical_bitwise_operators/logical_bitwise_bool.sts rename to migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/02.logical_bitwise_operators/logical_bitwise_bool.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/02.logical_bitwise_operators/logical_bitwise_boolean.sts b/migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/02.logical_bitwise_operators/logical_bitwise_boolean.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/02.logical_bitwise_operators/logical_bitwise_boolean.sts rename to migrator/test/staticTS/CTS/07.expressions/25.bitwise_and_logical_operators/02.logical_bitwise_operators/logical_bitwise_boolean.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/26.conditional_and_operator/conditional_and_bool.sts b/migrator/test/staticTS/CTS/07.expressions/26.conditional_and_operator/conditional_and_bool.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/26.conditional_and_operator/conditional_and_bool.sts rename to migrator/test/staticTS/CTS/07.expressions/26.conditional_and_operator/conditional_and_bool.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/26.conditional_and_operator/conditional_and_boolean.sts b/migrator/test/staticTS/CTS/07.expressions/26.conditional_and_operator/conditional_and_boolean.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/26.conditional_and_operator/conditional_and_boolean.sts rename to migrator/test/staticTS/CTS/07.expressions/26.conditional_and_operator/conditional_and_boolean.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/26.conditional_and_operator/tbd.n.conditional_and_bool.sts b/migrator/test/staticTS/CTS/07.expressions/26.conditional_and_operator/tbd.n.conditional_and_bool.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/26.conditional_and_operator/tbd.n.conditional_and_bool.sts rename to migrator/test/staticTS/CTS/07.expressions/26.conditional_and_operator/tbd.n.conditional_and_bool.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/27.conditional_or_operator/conditional_or_bool.sts b/migrator/test/staticTS/CTS/07.expressions/27.conditional_or_operator/conditional_or_bool.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/27.conditional_or_operator/conditional_or_bool.sts rename to migrator/test/staticTS/CTS/07.expressions/27.conditional_or_operator/conditional_or_bool.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/27.conditional_or_operator/conditional_or_boolean.sts b/migrator/test/staticTS/CTS/07.expressions/27.conditional_or_operator/conditional_or_boolean.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/27.conditional_or_operator/conditional_or_boolean.sts rename to migrator/test/staticTS/CTS/07.expressions/27.conditional_or_operator/conditional_or_boolean.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/27.conditional_or_operator/tbd.n.conditional_or_bool.sts b/migrator/test/staticTS/CTS/07.expressions/27.conditional_or_operator/tbd.n.conditional_or_bool.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/27.conditional_or_operator/tbd.n.conditional_or_bool.sts rename to migrator/test/staticTS/CTS/07.expressions/27.conditional_or_operator/tbd.n.conditional_or_bool.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/29.conditional_expressions/conditional_expression_evaluation.sts b/migrator/test/staticTS/CTS/07.expressions/29.conditional_expressions/conditional_expression_evaluation.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/29.conditional_expressions/conditional_expression_evaluation.sts rename to migrator/test/staticTS/CTS/07.expressions/29.conditional_expressions/conditional_expression_evaluation.ets diff --git a/migrator/test/staticTS/CTS/07.expressions/29.conditional_expressions/conditional_expression_order.sts b/migrator/test/staticTS/CTS/07.expressions/29.conditional_expressions/conditional_expression_order.ets similarity index 100% rename from migrator/test/staticTS/CTS/07.expressions/29.conditional_expressions/conditional_expression_order.sts rename to migrator/test/staticTS/CTS/07.expressions/29.conditional_expressions/conditional_expression_order.ets diff --git a/migrator/test/staticTS/CTS/08.statements/01.expression_statement/expression_statement.sts b/migrator/test/staticTS/CTS/08.statements/01.expression_statement/expression_statement.ets similarity index 100% rename from migrator/test/staticTS/CTS/08.statements/01.expression_statement/expression_statement.sts rename to migrator/test/staticTS/CTS/08.statements/01.expression_statement/expression_statement.ets diff --git a/migrator/test/staticTS/CTS/08.statements/02.block/block_statement.sts b/migrator/test/staticTS/CTS/08.statements/02.block/block_statement.ets similarity index 100% rename from migrator/test/staticTS/CTS/08.statements/02.block/block_statement.sts rename to migrator/test/staticTS/CTS/08.statements/02.block/block_statement.ets diff --git a/migrator/test/staticTS/CTS/08.statements/03.labeled_statement/labeled_statement.sts b/migrator/test/staticTS/CTS/08.statements/03.labeled_statement/labeled_statement.ets similarity index 100% rename from migrator/test/staticTS/CTS/08.statements/03.labeled_statement/labeled_statement.sts rename to migrator/test/staticTS/CTS/08.statements/03.labeled_statement/labeled_statement.ets diff --git a/migrator/test/staticTS/CTS/08.statements/04.local_declarations/local_class.sts b/migrator/test/staticTS/CTS/08.statements/04.local_declarations/local_class.ets similarity index 100% rename from migrator/test/staticTS/CTS/08.statements/04.local_declarations/local_class.sts rename to migrator/test/staticTS/CTS/08.statements/04.local_declarations/local_class.ets diff --git a/migrator/test/staticTS/CTS/08.statements/04.local_declarations/local_const.sts b/migrator/test/staticTS/CTS/08.statements/04.local_declarations/local_const.ets similarity index 100% rename from migrator/test/staticTS/CTS/08.statements/04.local_declarations/local_const.sts rename to migrator/test/staticTS/CTS/08.statements/04.local_declarations/local_const.ets diff --git a/migrator/test/staticTS/CTS/08.statements/04.local_declarations/local_var.sts b/migrator/test/staticTS/CTS/08.statements/04.local_declarations/local_var.ets similarity index 100% rename from migrator/test/staticTS/CTS/08.statements/04.local_declarations/local_var.sts rename to migrator/test/staticTS/CTS/08.statements/04.local_declarations/local_var.ets diff --git a/migrator/test/staticTS/CTS/08.statements/04.local_declarations/n.local_class.sts b/migrator/test/staticTS/CTS/08.statements/04.local_declarations/n.local_class.ets similarity index 100% rename from migrator/test/staticTS/CTS/08.statements/04.local_declarations/n.local_class.sts rename to migrator/test/staticTS/CTS/08.statements/04.local_declarations/n.local_class.ets diff --git a/migrator/test/staticTS/CTS/08.statements/04.local_declarations/n.local_const.sts b/migrator/test/staticTS/CTS/08.statements/04.local_declarations/n.local_const.ets similarity index 100% rename from migrator/test/staticTS/CTS/08.statements/04.local_declarations/n.local_const.sts rename to migrator/test/staticTS/CTS/08.statements/04.local_declarations/n.local_const.ets diff --git a/migrator/test/staticTS/CTS/08.statements/04.local_declarations/n.local_var.sts b/migrator/test/staticTS/CTS/08.statements/04.local_declarations/n.local_var.ets similarity index 100% rename from migrator/test/staticTS/CTS/08.statements/04.local_declarations/n.local_var.sts rename to migrator/test/staticTS/CTS/08.statements/04.local_declarations/n.local_var.ets diff --git a/migrator/test/staticTS/CTS/08.statements/05.if_statement/if.sts b/migrator/test/staticTS/CTS/08.statements/05.if_statement/if.ets similarity index 100% rename from migrator/test/staticTS/CTS/08.statements/05.if_statement/if.sts rename to migrator/test/staticTS/CTS/08.statements/05.if_statement/if.ets diff --git a/migrator/test/staticTS/CTS/08.statements/05.if_statement/if_not_executed.sts b/migrator/test/staticTS/CTS/08.statements/05.if_statement/if_not_executed.ets similarity index 100% rename from migrator/test/staticTS/CTS/08.statements/05.if_statement/if_not_executed.sts rename to migrator/test/staticTS/CTS/08.statements/05.if_statement/if_not_executed.ets diff --git a/migrator/test/staticTS/CTS/08.statements/05.if_statement/nested_if.sts b/migrator/test/staticTS/CTS/08.statements/05.if_statement/nested_if.ets similarity index 100% rename from migrator/test/staticTS/CTS/08.statements/05.if_statement/nested_if.sts rename to migrator/test/staticTS/CTS/08.statements/05.if_statement/nested_if.ets diff --git a/migrator/test/staticTS/CTS/08.statements/06.while_and_do_statements/do.sts b/migrator/test/staticTS/CTS/08.statements/06.while_and_do_statements/do.ets similarity index 100% rename from migrator/test/staticTS/CTS/08.statements/06.while_and_do_statements/do.sts rename to migrator/test/staticTS/CTS/08.statements/06.while_and_do_statements/do.ets diff --git a/migrator/test/staticTS/CTS/08.statements/06.while_and_do_statements/while.sts b/migrator/test/staticTS/CTS/08.statements/06.while_and_do_statements/while.ets similarity index 100% rename from migrator/test/staticTS/CTS/08.statements/06.while_and_do_statements/while.sts rename to migrator/test/staticTS/CTS/08.statements/06.while_and_do_statements/while.ets diff --git a/migrator/test/staticTS/CTS/08.statements/06.while_and_do_statements/while_not_executed.sts b/migrator/test/staticTS/CTS/08.statements/06.while_and_do_statements/while_not_executed.ets similarity index 100% rename from migrator/test/staticTS/CTS/08.statements/06.while_and_do_statements/while_not_executed.sts rename to migrator/test/staticTS/CTS/08.statements/06.while_and_do_statements/while_not_executed.ets diff --git a/migrator/test/staticTS/CTS/08.statements/07.for_statement/for_existing.sts b/migrator/test/staticTS/CTS/08.statements/07.for_statement/for_existing.ets similarity index 100% rename from migrator/test/staticTS/CTS/08.statements/07.for_statement/for_existing.sts rename to migrator/test/staticTS/CTS/08.statements/07.for_statement/for_existing.ets diff --git a/migrator/test/staticTS/CTS/08.statements/07.for_statement/for_new.sts b/migrator/test/staticTS/CTS/08.statements/07.for_statement/for_new.ets similarity index 100% rename from migrator/test/staticTS/CTS/08.statements/07.for_statement/for_new.sts rename to migrator/test/staticTS/CTS/08.statements/07.for_statement/for_new.ets diff --git a/migrator/test/staticTS/CTS/08.statements/07.for_statement/for_new_implicit.sts b/migrator/test/staticTS/CTS/08.statements/07.for_statement/for_new_implicit.ets similarity index 100% rename from migrator/test/staticTS/CTS/08.statements/07.for_statement/for_new_implicit.sts rename to migrator/test/staticTS/CTS/08.statements/07.for_statement/for_new_implicit.ets diff --git a/migrator/test/staticTS/CTS/08.statements/08.for_of_statement/for_of_new.sts b/migrator/test/staticTS/CTS/08.statements/08.for_of_statement/for_of_new.ets similarity index 100% rename from migrator/test/staticTS/CTS/08.statements/08.for_of_statement/for_of_new.sts rename to migrator/test/staticTS/CTS/08.statements/08.for_of_statement/for_of_new.ets diff --git a/migrator/test/staticTS/CTS/08.statements/08.for_of_statement/for_of_new_type.sts b/migrator/test/staticTS/CTS/08.statements/08.for_of_statement/for_of_new_type.ets similarity index 100% rename from migrator/test/staticTS/CTS/08.statements/08.for_of_statement/for_of_new_type.sts rename to migrator/test/staticTS/CTS/08.statements/08.for_of_statement/for_of_new_type.ets diff --git a/migrator/test/staticTS/CTS/08.statements/09.break_statement/break.sts b/migrator/test/staticTS/CTS/08.statements/09.break_statement/break.ets similarity index 100% rename from migrator/test/staticTS/CTS/08.statements/09.break_statement/break.sts rename to migrator/test/staticTS/CTS/08.statements/09.break_statement/break.ets diff --git a/migrator/test/staticTS/CTS/08.statements/10.continue_statement/continue_while.sts b/migrator/test/staticTS/CTS/08.statements/10.continue_statement/continue_while.ets similarity index 100% rename from migrator/test/staticTS/CTS/08.statements/10.continue_statement/continue_while.sts rename to migrator/test/staticTS/CTS/08.statements/10.continue_statement/continue_while.ets diff --git a/migrator/test/staticTS/CTS/08.statements/11.return_statement/return.sts b/migrator/test/staticTS/CTS/08.statements/11.return_statement/return.ets similarity index 100% rename from migrator/test/staticTS/CTS/08.statements/11.return_statement/return.sts rename to migrator/test/staticTS/CTS/08.statements/11.return_statement/return.ets diff --git a/migrator/test/staticTS/CTS/08.statements/12.switch_statement/n.switch_duplicate.sts b/migrator/test/staticTS/CTS/08.statements/12.switch_statement/n.switch_duplicate.ets similarity index 100% rename from migrator/test/staticTS/CTS/08.statements/12.switch_statement/n.switch_duplicate.sts rename to migrator/test/staticTS/CTS/08.statements/12.switch_statement/n.switch_duplicate.ets diff --git a/migrator/test/staticTS/CTS/08.statements/12.switch_statement/switch.sts b/migrator/test/staticTS/CTS/08.statements/12.switch_statement/switch.ets similarity index 100% rename from migrator/test/staticTS/CTS/08.statements/12.switch_statement/switch.sts rename to migrator/test/staticTS/CTS/08.statements/12.switch_statement/switch.ets diff --git a/migrator/test/staticTS/CTS/08.statements/12.switch_statement/switch_block.sts b/migrator/test/staticTS/CTS/08.statements/12.switch_statement/switch_block.ets similarity index 100% rename from migrator/test/staticTS/CTS/08.statements/12.switch_statement/switch_block.sts rename to migrator/test/staticTS/CTS/08.statements/12.switch_statement/switch_block.ets diff --git a/migrator/test/staticTS/CTS/08.statements/12.switch_statement/switch_char.sts b/migrator/test/staticTS/CTS/08.statements/12.switch_statement/switch_char.ets similarity index 100% rename from migrator/test/staticTS/CTS/08.statements/12.switch_statement/switch_char.sts rename to migrator/test/staticTS/CTS/08.statements/12.switch_statement/switch_char.ets diff --git a/migrator/test/staticTS/CTS/08.statements/12.switch_statement/switch_enum.sts b/migrator/test/staticTS/CTS/08.statements/12.switch_statement/switch_enum.ets similarity index 100% rename from migrator/test/staticTS/CTS/08.statements/12.switch_statement/switch_enum.sts rename to migrator/test/staticTS/CTS/08.statements/12.switch_statement/switch_enum.ets diff --git a/migrator/test/staticTS/CTS/08.statements/13.assert_statement/assert.sts b/migrator/test/staticTS/CTS/08.statements/13.assert_statement/assert.ets similarity index 100% rename from migrator/test/staticTS/CTS/08.statements/13.assert_statement/assert.sts rename to migrator/test/staticTS/CTS/08.statements/13.assert_statement/assert.ets diff --git a/migrator/test/staticTS/CTS/08.statements/13.assert_statement/ne.assert.sts b/migrator/test/staticTS/CTS/08.statements/13.assert_statement/ne.assert.ets similarity index 100% rename from migrator/test/staticTS/CTS/08.statements/13.assert_statement/ne.assert.sts rename to migrator/test/staticTS/CTS/08.statements/13.assert_statement/ne.assert.ets diff --git a/migrator/test/staticTS/CTS/08.statements/13.assert_statement/ne.assert_str.sts b/migrator/test/staticTS/CTS/08.statements/13.assert_statement/ne.assert_str.ets similarity index 100% rename from migrator/test/staticTS/CTS/08.statements/13.assert_statement/ne.assert_str.sts rename to migrator/test/staticTS/CTS/08.statements/13.assert_statement/ne.assert_str.ets diff --git a/migrator/test/staticTS/CTS/08.statements/16.panic_statement/ne.panic_statement.sts b/migrator/test/staticTS/CTS/08.statements/16.panic_statement/ne.panic_statement.ets similarity index 100% rename from migrator/test/staticTS/CTS/08.statements/16.panic_statement/ne.panic_statement.sts rename to migrator/test/staticTS/CTS/08.statements/16.panic_statement/ne.panic_statement.ets diff --git a/migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/01.abstract_classes/abstract.sts b/migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/01.abstract_classes/abstract.ets similarity index 100% rename from migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/01.abstract_classes/abstract.sts rename to migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/01.abstract_classes/abstract.ets diff --git a/migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/01.abstract_classes/abstract_method.sts b/migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/01.abstract_classes/abstract_method.ets similarity index 100% rename from migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/01.abstract_classes/abstract_method.sts rename to migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/01.abstract_classes/abstract_method.ets diff --git a/migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/01.abstract_classes/n.abstract_instantiate.sts b/migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/01.abstract_classes/n.abstract_instantiate.ets similarity index 100% rename from migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/01.abstract_classes/n.abstract_instantiate.sts rename to migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/01.abstract_classes/n.abstract_instantiate.ets diff --git a/migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/01.abstract_classes/n.abstract_method.sts b/migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/01.abstract_classes/n.abstract_method.ets similarity index 100% rename from migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/01.abstract_classes/n.abstract_method.sts rename to migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/01.abstract_classes/n.abstract_method.ets diff --git a/migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/01.abstract_classes/n.abstract_open.sts b/migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/01.abstract_classes/n.abstract_open.ets similarity index 100% rename from migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/01.abstract_classes/n.abstract_open.sts rename to migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/01.abstract_classes/n.abstract_open.ets diff --git a/migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/02.open_classes/n.open_class.sts b/migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/02.open_classes/n.open_class.ets similarity index 100% rename from migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/02.open_classes/n.open_class.sts rename to migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/02.open_classes/n.open_class.ets diff --git a/migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/02.open_classes/open_class.sts b/migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/02.open_classes/open_class.ets similarity index 100% rename from migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/02.open_classes/open_class.sts rename to migrator/test/staticTS/CTS/09.classes/01.class_declaration/01.class_modifiers/02.open_classes/open_class.ets diff --git a/migrator/test/staticTS/CTS/09.classes/01.class_declaration/04.class_body/class_members.sts b/migrator/test/staticTS/CTS/09.classes/01.class_declaration/04.class_body/class_members.ets similarity index 100% rename from migrator/test/staticTS/CTS/09.classes/01.class_declaration/04.class_body/class_members.sts rename to migrator/test/staticTS/CTS/09.classes/01.class_declaration/04.class_body/class_members.ets diff --git a/migrator/test/staticTS/CTS/09.classes/01.class_declaration/04.class_body/n.class_members.sts b/migrator/test/staticTS/CTS/09.classes/01.class_declaration/04.class_body/n.class_members.ets similarity index 100% rename from migrator/test/staticTS/CTS/09.classes/01.class_declaration/04.class_body/n.class_members.sts rename to migrator/test/staticTS/CTS/09.classes/01.class_declaration/04.class_body/n.class_members.ets diff --git a/migrator/test/staticTS/CTS/09.classes/01.class_declaration/point.sts b/migrator/test/staticTS/CTS/09.classes/01.class_declaration/point.ets similarity index 100% rename from migrator/test/staticTS/CTS/09.classes/01.class_declaration/point.sts rename to migrator/test/staticTS/CTS/09.classes/01.class_declaration/point.ets diff --git a/migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/empty_interface_declaration.sts b/migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/empty_interface_declaration.ets similarity index 100% rename from migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/empty_interface_declaration.sts rename to migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/empty_interface_declaration.ets diff --git a/migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/empty_interface_declaration_with_type_params.sts b/migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/empty_interface_declaration_with_type_params.ets similarity index 100% rename from migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/empty_interface_declaration_with_type_params.sts rename to migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/empty_interface_declaration_with_type_params.ets diff --git a/migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/interface_fields.sts b/migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/interface_fields.ets similarity index 100% rename from migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/interface_fields.sts rename to migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/interface_fields.ets diff --git a/migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/interface_fields_without_types.sts b/migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/interface_fields_without_types.ets similarity index 100% rename from migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/interface_fields_without_types.sts rename to migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/interface_fields_without_types.ets diff --git a/migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/n.interface_extends_without_type.sts b/migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/n.interface_extends_without_type.ets similarity index 100% rename from migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/n.interface_extends_without_type.sts rename to migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/n.interface_extends_without_type.ets diff --git a/migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/several_interface_fields.sts b/migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/several_interface_fields.ets similarity index 100% rename from migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/several_interface_fields.sts rename to migrator/test/staticTS/CTS/10.interfaces/01.interface_declarations/several_interface_fields.ets diff --git a/migrator/test/staticTS/CTS/10.interfaces/05.interface_field_declarations/interface_field_decl.sts b/migrator/test/staticTS/CTS/10.interfaces/05.interface_field_declarations/interface_field_decl.ets similarity index 100% rename from migrator/test/staticTS/CTS/10.interfaces/05.interface_field_declarations/interface_field_decl.sts rename to migrator/test/staticTS/CTS/10.interfaces/05.interface_field_declarations/interface_field_decl.ets diff --git a/migrator/test/staticTS/CTS/10.interfaces/06.interface_method_declaration/01.static_interface_methods/n.static_interface_methods.sts b/migrator/test/staticTS/CTS/10.interfaces/06.interface_method_declaration/01.static_interface_methods/n.static_interface_methods.ets similarity index 100% rename from migrator/test/staticTS/CTS/10.interfaces/06.interface_method_declaration/01.static_interface_methods/n.static_interface_methods.sts rename to migrator/test/staticTS/CTS/10.interfaces/06.interface_method_declaration/01.static_interface_methods/n.static_interface_methods.ets diff --git a/migrator/test/staticTS/CTS/10.interfaces/06.interface_method_declaration/01.static_interface_methods/static_interface_methods.sts b/migrator/test/staticTS/CTS/10.interfaces/06.interface_method_declaration/01.static_interface_methods/static_interface_methods.ets similarity index 100% rename from migrator/test/staticTS/CTS/10.interfaces/06.interface_method_declaration/01.static_interface_methods/static_interface_methods.sts rename to migrator/test/staticTS/CTS/10.interfaces/06.interface_method_declaration/01.static_interface_methods/static_interface_methods.ets diff --git a/migrator/test/staticTS/CTS/10.interfaces/06.interface_method_declaration/02.private_interface_methods/n.private_interface_methods.sts b/migrator/test/staticTS/CTS/10.interfaces/06.interface_method_declaration/02.private_interface_methods/n.private_interface_methods.ets similarity index 100% rename from migrator/test/staticTS/CTS/10.interfaces/06.interface_method_declaration/02.private_interface_methods/n.private_interface_methods.sts rename to migrator/test/staticTS/CTS/10.interfaces/06.interface_method_declaration/02.private_interface_methods/n.private_interface_methods.ets diff --git a/migrator/test/staticTS/CTS/10.interfaces/06.interface_method_declaration/02.private_interface_methods/n.private_interface_methods_static.sts b/migrator/test/staticTS/CTS/10.interfaces/06.interface_method_declaration/02.private_interface_methods/n.private_interface_methods_static.ets similarity index 100% rename from migrator/test/staticTS/CTS/10.interfaces/06.interface_method_declaration/02.private_interface_methods/n.private_interface_methods_static.sts rename to migrator/test/staticTS/CTS/10.interfaces/06.interface_method_declaration/02.private_interface_methods/n.private_interface_methods_static.ets diff --git a/migrator/test/staticTS/CTS/10.interfaces/06.interface_method_declaration/02.private_interface_methods/private_interface_methods.sts b/migrator/test/staticTS/CTS/10.interfaces/06.interface_method_declaration/02.private_interface_methods/private_interface_methods.ets similarity index 100% rename from migrator/test/staticTS/CTS/10.interfaces/06.interface_method_declaration/02.private_interface_methods/private_interface_methods.sts rename to migrator/test/staticTS/CTS/10.interfaces/06.interface_method_declaration/02.private_interface_methods/private_interface_methods.ets diff --git a/migrator/test/staticTS/CTS/11.enums/01.enum_constants/any_number_of_constants.sts b/migrator/test/staticTS/CTS/11.enums/01.enum_constants/any_number_of_constants.ets similarity index 100% rename from migrator/test/staticTS/CTS/11.enums/01.enum_constants/any_number_of_constants.sts rename to migrator/test/staticTS/CTS/11.enums/01.enum_constants/any_number_of_constants.ets diff --git a/migrator/test/staticTS/CTS/11.enums/01.enum_constants/n.empty_enum.sts b/migrator/test/staticTS/CTS/11.enums/01.enum_constants/n.empty_enum.ets similarity index 100% rename from migrator/test/staticTS/CTS/11.enums/01.enum_constants/n.empty_enum.sts rename to migrator/test/staticTS/CTS/11.enums/01.enum_constants/n.empty_enum.ets diff --git a/migrator/test/staticTS/CTS/11.enums/01.enum_constants/n.repeating_constants.sts b/migrator/test/staticTS/CTS/11.enums/01.enum_constants/n.repeating_constants.ets similarity index 100% rename from migrator/test/staticTS/CTS/11.enums/01.enum_constants/n.repeating_constants.sts rename to migrator/test/staticTS/CTS/11.enums/01.enum_constants/n.repeating_constants.ets diff --git a/migrator/test/staticTS/CTS/11.enums/01.enum_constants/n.trailing_comma_enum.sts b/migrator/test/staticTS/CTS/11.enums/01.enum_constants/n.trailing_comma_enum.ets similarity index 100% rename from migrator/test/staticTS/CTS/11.enums/01.enum_constants/n.trailing_comma_enum.sts rename to migrator/test/staticTS/CTS/11.enums/01.enum_constants/n.trailing_comma_enum.ets diff --git a/migrator/test/staticTS/CTS/11.enums/01.enum_constants/simple_enum.sts b/migrator/test/staticTS/CTS/11.enums/01.enum_constants/simple_enum.ets similarity index 100% rename from migrator/test/staticTS/CTS/11.enums/01.enum_constants/simple_enum.sts rename to migrator/test/staticTS/CTS/11.enums/01.enum_constants/simple_enum.ets diff --git a/migrator/test/staticTS/CTS/11.enums/02.enum_type_methods/enum_type_methods_valueof.sts b/migrator/test/staticTS/CTS/11.enums/02.enum_type_methods/enum_type_methods_valueof.ets similarity index 100% rename from migrator/test/staticTS/CTS/11.enums/02.enum_type_methods/enum_type_methods_valueof.sts rename to migrator/test/staticTS/CTS/11.enums/02.enum_type_methods/enum_type_methods_valueof.ets diff --git a/migrator/test/staticTS/CTS/11.enums/02.enum_type_methods/enum_type_methods_values.sts b/migrator/test/staticTS/CTS/11.enums/02.enum_type_methods/enum_type_methods_values.ets similarity index 100% rename from migrator/test/staticTS/CTS/11.enums/02.enum_type_methods/enum_type_methods_values.sts rename to migrator/test/staticTS/CTS/11.enums/02.enum_type_methods/enum_type_methods_values.ets diff --git a/migrator/test/staticTS/CTS/11.enums/03.enum_constant_methods/enum_constant_ordinals.sts b/migrator/test/staticTS/CTS/11.enums/03.enum_constant_methods/enum_constant_ordinals.ets similarity index 100% rename from migrator/test/staticTS/CTS/11.enums/03.enum_constant_methods/enum_constant_ordinals.sts rename to migrator/test/staticTS/CTS/11.enums/03.enum_constant_methods/enum_constant_ordinals.ets diff --git a/migrator/test/staticTS/CTS/11.enums/03.enum_constant_methods/enum_constant_to_string.sts b/migrator/test/staticTS/CTS/11.enums/03.enum_constant_methods/enum_constant_to_string.ets similarity index 100% rename from migrator/test/staticTS/CTS/11.enums/03.enum_constant_methods/enum_constant_to_string.sts rename to migrator/test/staticTS/CTS/11.enums/03.enum_constant_methods/enum_constant_to_string.ets diff --git a/migrator/test/staticTS/CTS/13.packages/02.import_declarations/import.sts b/migrator/test/staticTS/CTS/13.packages/02.import_declarations/import.ets similarity index 100% rename from migrator/test/staticTS/CTS/13.packages/02.import_declarations/import.sts rename to migrator/test/staticTS/CTS/13.packages/02.import_declarations/import.ets diff --git a/migrator/test/staticTS/CTS/13.packages/02.import_declarations/import_as.sts b/migrator/test/staticTS/CTS/13.packages/02.import_declarations/import_as.ets similarity index 100% rename from migrator/test/staticTS/CTS/13.packages/02.import_declarations/import_as.sts rename to migrator/test/staticTS/CTS/13.packages/02.import_declarations/import_as.ets diff --git a/migrator/test/staticTS/CTS/13.packages/02.import_declarations/n.import_all_as.sts b/migrator/test/staticTS/CTS/13.packages/02.import_declarations/n.import_all_as.ets similarity index 100% rename from migrator/test/staticTS/CTS/13.packages/02.import_declarations/n.import_all_as.sts rename to migrator/test/staticTS/CTS/13.packages/02.import_declarations/n.import_all_as.ets diff --git a/migrator/test/staticTS/CTS/13.packages/05.export_declarations/export_declarations.sts b/migrator/test/staticTS/CTS/13.packages/05.export_declarations/export_declarations.ets similarity index 100% rename from migrator/test/staticTS/CTS/13.packages/05.export_declarations/export_declarations.sts rename to migrator/test/staticTS/CTS/13.packages/05.export_declarations/export_declarations.ets diff --git a/migrator/test/staticTS/CTS/13.packages/05.export_declarations/n.exported_grouped_declarations.sts b/migrator/test/staticTS/CTS/13.packages/05.export_declarations/n.exported_grouped_declarations.ets similarity index 100% rename from migrator/test/staticTS/CTS/13.packages/05.export_declarations/n.exported_grouped_declarations.sts rename to migrator/test/staticTS/CTS/13.packages/05.export_declarations/n.exported_grouped_declarations.ets diff --git a/migrator/test/staticTS/CTS/13.packages/06.program_entry_point/multiple_entrypoints.sts b/migrator/test/staticTS/CTS/13.packages/06.program_entry_point/multiple_entrypoints.ets similarity index 100% rename from migrator/test/staticTS/CTS/13.packages/06.program_entry_point/multiple_entrypoints.sts rename to migrator/test/staticTS/CTS/13.packages/06.program_entry_point/multiple_entrypoints.ets -- Gitee