| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ets-templates/07.expressions/01.evaluation_of_expressions/03.operator_precedence/ |
| D | typeof.ets | 23 let str: string = "" 28 str = typeof num++ 29 if (str != "number" || num != 2.0) return 1; 30 str = "" 32 str = typeof num-- 33 if (str != "number" || num != 1.0) return 1; 34 str = "" 36 str = typeof typeof num++ 37 if (str != "string" || num != 2.0) return 1; 38 str = "" [all …]
|
| /arkcompiler/ets_runtime/test/aottest/builtins_string/ |
| D | builtins_string.ts | 25 let str = "sd-93u498thikefnow8y3-0rh1nalksfnwo8y3t19-3r8hoiefnw"; 27 print(str.substring(0)); 29 print(str.substring(-0.01)); 31 print(str.substring(0.01)); 33 print(str.substring(100)); 35 print(str.substring(-100)); 37 print(str.substring(10)); 39 print(str.substring(-10)); 41 print(str.substring(undefined)); 43 print(str.substring(num4)); [all …]
|
| /arkcompiler/ets_runtime/ecmascript/tests/ |
| D | js_date_test.cpp | 69 CString str = "2020-11-19T12:18:18.132Z"; in HWTEST_F_L0() local 70 JSTaggedValue ms = ecmascript::JSDate::GetTimeFromString(str.c_str(), str.length()); in HWTEST_F_L0() 73 str = "1880-12-30T23:59:59"; in HWTEST_F_L0() 74 ms = ecmascript::JSDate::GetTimeFromString(str.c_str(), str.length()); in HWTEST_F_L0() 77 str = "2020-11-19Z"; in HWTEST_F_L0() 78 ms = ecmascript::JSDate::GetTimeFromString(str.c_str(), str.length()); in HWTEST_F_L0() 81 str = "2020-11"; in HWTEST_F_L0() 82 ms = ecmascript::JSDate::GetTimeFromString(str.c_str(), str.length()); in HWTEST_F_L0() 85 str = "2023-1-11"; in HWTEST_F_L0() 86 ms = ecmascript::JSDate::GetTimeFromString(str.c_str(), str.length()); in HWTEST_F_L0() [all …]
|
| /arkcompiler/ets_runtime/common_components/base/tests/ |
| D | c_string_test.cpp | 118 CString str = "hello world hello panda"; in HWTEST_F_L0() local 121 str.ReplaceAll(replacement, target); in HWTEST_F_L0() 122 EXPECT_STREQ(str.Str(), "hillo world hillo panda"); in HWTEST_F_L0() 128 EXPECT_STREQ(str1.Str(), "hello world"); in HWTEST_F_L0() 135 EXPECT_STREQ(result1.Str(), ""); in HWTEST_F_L0() 139 EXPECT_STREQ(result2.Str(), "HelloWorld"); in HWTEST_F_L0() 143 EXPECT_STREQ(result3.Str(), "Thisisateststring"); in HWTEST_F_L0() 147 EXPECT_STREQ(result4.Str(), ""); in HWTEST_F_L0() 195 CString str("abcdef"); in HWTEST_F_L0() local 196 EXPECT_EQ(std::string(str.SubStr(2, 3).Str()), "cde"); in HWTEST_F_L0() [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ets-templates/03.types/15.literal_types/ |
| D | function_literal_type.params.yaml | 21 function foo(i: "some str") { } 23 let a: "another str" = "another str" 31 function foo(i: "some str") { } 33 foo(new string("some str")) 38 function foo(i: "some str", j: null, k: undefined) { 39 assertEQ( i, "some str") 44 foo("some str", null, undefined) 50 assertEQ( i, "some str") 55 foo("some str", null, undefined) 56 let a: string = "some str" [all …]
|
| D | custom_literal_type.params.yaml | 19 type LITERAL = "some str" 21 let a: LITERAL = "some str" 22 assertTrue( a instanceof "some str" ) 24 assertEQ( a, "some str" ) 30 let a: "some str" | "another str" | Number | boolean | string = "some str" 31 assertEQ( a, "some str" ) 32 a = "another str" 33 assertEQ( a, "another str" ) 36 a = "str" 37 assertEQ( a, "str" ) [all …]
|
| D | class_literal_type.params.yaml | 20 i: "some str" = "some str" 26 assertEQ( a.i, "some str" ) 34 i: "some str" 39 this.i = "some str" 46 assertEQ( a.i, "some str" ) 54 i: "some str" 59 this.i = "some str" 64 constructor(i: "some str", j: undefined, k: null) { 71 let i: "some str" = "some str" 75 assertEQ( b.i, "some str" ) [all …]
|
| /arkcompiler/runtime_core/static_core/tests/tests-u-runner-2/runner/ |
| D | utils.py | 59 def download(name: str, *, git_url: str, revision: str, download_root: Path, target_path: Path, argument 89 def download_and_generate(name: str, url: str, revision: str, download_root: Path, generated_root: … argument 90 … stamp_name: str | None = None, test_subdir: str = "test", show_progress: bool = False, argument 147 def read_file(file_path: Path | str) -> str: argument 153 def write_2_file(file_path: Path | str, content: str) -> None: argument 162 def purify(line: str) -> str: argument 166 def get_all_enum_values(enum_cls: type[EnumT], *, delim: str = ", ", quotes: str = "'") -> str: argument 173 def wrap_with_function(code: str, jit_preheat_repeats: int) -> str: argument 185 def iter_files(dirpath: Path | str, allowed_ext: list[str]) -> Iterator[tuple[str, str]]: argument 186 dirpath_gen = ((name, path.join(str(dirpath), name)) for name in os.listdir(str(dirpath))) [all …]
|
| /arkcompiler/runtime_core/static_core/tests/tests-u-runner/runner/enum_types/ |
| D | params.py | 35 cmd_prefix: List[str] 36 cmd_env: Dict[str, str] 41 es2panda: str 42 es2panda_args: List[str] 45 runtime: str 46 runtime_args: List[str] 49 ark_aot: Optional[str] 50 aot_args: List[str] 53 ark_quick: str 54 quick_args: List[str] [all …]
|
| /arkcompiler/ets_runtime/test/aottest/exception_case14/ |
| D | exception_case14.js | 39 var alphabet, cc, caseChanged, ee, i, isNum, length, str, 70 str = String(vv); 73 if (!isNumeric.test(str = String(vv))) return parseNumeric(xx, str, isNum); 75 xx.s = str.charCodeAt(0) == 45 ? (str = str.slice(1), -1) : 1; 77 if ((ee = str.indexOf('.')) > -1) str = str.replace('.', ''); 78 if ((i = str.search(/ee/i)) > 0) { 80 ee += +str.slice(i + 1); 81 str = str.substring(0, i); 83 ee = str.length; 92 str = String(vv); [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ets-templates/05.generics/03.utility_types/03.readonly_utility_type/ |
| D | readonly_type_of_union.params.yaml | 16 - { argument: "{i: 3.9, j: \"some str\"}", class: "A", num: "3.9", str: "\"some str\"" } 17 - { argument: "{i: 3.9, j: \"some str\"}", class: "C", num: "3.9", str: "\"some str\"" } 18 - { argument: "{i: 3.9}", class: "A", num: "3.9", str: "\"A\"" } 19 - { argument: "{i: 3.9}", class: "C", num: "3.9", str: "\"C\"" } 20 - { argument: "{j: \"some str\"}", class: "A", num: "1.7", str: "\"some str\"" } 21 - { argument: "{j: \"some str\"}", class: "C", num: "2.6", str: "\"some str\"" } 22 - { argument: "{}", class: "A", num: "1.7", str: "\"A\"" } 23 - { argument: "{}", class: "C", num: "2.6", str: "\"C\"" }
|
| D | readonly_type.params.yaml | 16 - { argument: "{i: 3.9, j: \"some str\"}", class: "A", num: "3.9", str: "\"some str\"" } 17 - { argument: "{i: 3.9, j: \"some str\"}", class: "C", num: "3.9", str: "\"some str\"" } 18 - { argument: "{i: 3.9}", class: "A", num: "3.9", str: "\"A\"" } 19 - { argument: "{i: 3.9}", class: "C", num: "3.9", str: "\"C\"" } 20 - { argument: "{j: \"some str\"}", class: "A", num: "1.7", str: "\"some str\"" } 21 - { argument: "{j: \"some str\"}", class: "C", num: "2.6", str: "\"some str\"" } 22 - { argument: "{}", class: "A", num: "1.7", str: "\"A\"" } 23 - { argument: "{}", class: "C", num: "2.6", str: "\"C\"" }
|
| /arkcompiler/runtime_core/panda_guard/util/ |
| D | string_util.cpp | 31 std::vector<std::string> panda::guard::StringUtil::Split(const std::string &str, const std::string … in Split() argument 34 auto start = str.find_first_not_of(delimiter, 0); in Split() 35 auto pos = str.find_first_of(delimiter, 0); in Split() 38 tokens.push_back(str.substr(start, pos - start)); in Split() 40 start = str.find_first_not_of(delimiter, pos); in Split() 41 pos = str.find_first_of(delimiter, start + 1); in Split() 47 std::vector<std::string> panda::guard::StringUtil::StrictSplit(const std::string &str, const std::s… in StrictSplit() argument 52 while (start <= str.size()) { in StrictSplit() 53 end = str.find_first_of(delimiter, start); in StrictSplit() 55 end = str.size(); in StrictSplit() [all …]
|
| /arkcompiler/runtime_core/static_core/tests/vm-benchmarks/src/vmb/ |
| D | shell.py | 43 out: str = '' 44 err: str = '' 48 def grep(self, regex: str) -> str: argument 59 def replace_out(self, regex: re.Pattern, repl: str = '') -> None: argument 87 self.tm = float(str(tmp[1]) + "." + tmp[2]) 89 self.tm = int(tmp[0]) * 60 + float(str(tmp[1]) + "." + tmp[2]) 119 def timed_cmd(cmd: str) -> str: argument 123 cmd: str, argument 126 cwd: str = '') -> ShellResult: argument 129 def run_async(self, cmd: str) -> None: argument [all …]
|
| /arkcompiler/runtime_core/static_core/tests/tests-u-runner-2/runner/options/ |
| D | step.py | 31 PropType = str | int | bool | list[str] | dict[str, Any] | BaseEnum # type: ignore[explicit-any] 44 name: str 46 args: list[str] 47 env: dict[str, str] 60 def __init__(self, name: str, step_body: dict[str, Any]): # type: ignore[explicit-any] argument 71 def __str__(self) -> str: 89 def __get_int_property(step_body: dict[str, Any], # type: ignore[explicit-any] argument 90 name: str, default: int | None = None) -> int: argument 98 def __get_bool_property(step_body: dict[str, Any], # type: ignore[explicit-any] argument 99 name: str, default: bool | None = None) -> bool: argument [all …]
|
| D | macros.py | 33 def add_steps_2_macro(macro: str) -> str: argument 40 def remove_parameters_and_minuses(macro: str) -> str: argument 47 def expand_macros_in_path(cls, value: str, config: IOptions) -> str | None: argument 49 return expand_file_name(corrected) if isinstance(corrected, str) else None 52 def correct_macro(cls, raw_value: str, config: IOptions) -> str | list[str]: argument 54 Macro can be expanded into single value of str or to list of str 59 If a macro is expanded into list of str the 2 cases are possible: 61 in this case the list of str is returned 63 in this case the list is converted into the str 82 def __process(cls, result: str, raw_value: str, config: IOptions) -> tuple[str, list[str]]: argument [all …]
|
| /arkcompiler/toolchain/websocket/ |
| D | string_utils.h | 25 inline void TrimLeft(std::string &str) in TrimLeft() argument 27 …str.erase(str.begin(), std::find_if(str.begin(), str.end(), [](unsigned char ch) { return !std::is… in TrimLeft() 30 inline void TrimRight(std::string &str) in TrimRight() argument 32 …str.erase(std::find_if(str.rbegin(), str.rend(), [](unsigned char ch) { return !std::isspace(ch); … in TrimRight() 33 str.end()); in TrimRight() 36 inline void Trim(std::string &str) in Trim() argument 38 TrimLeft(str); in Trim() 39 TrimRight(str); in Trim() 42 inline void ToLowerCase(std::string& str) in ToLowerCase() argument 44 …std::transform(str.begin(), str.end(), str.begin(), [](unsigned char c) { return std::tolower(c); … in ToLowerCase()
|
| /arkcompiler/runtime_core/static_core/tests/tests-u-runner/runner/ |
| D | chapters.py | 30 name: str 31 includes: List[str] 32 excludes: List[str] 36 def __init__(self, chapters_name: str) -> None: argument 42 def __init__(self, item: str) -> None: argument 51 def __init__(self, chapters_file: str): argument 56 def __parse(chapters_file: str) -> Dict[str, Chapter]: argument 57 result: Dict[str, Chapter] = {} 58 yaml_header: Dict[str, Any] = YamlDocument.load(chapters_file) 78 def __parse_item(includes: List[str], excludes: List[str], yaml_item: Union[str, dict]) -> None: argument [all …]
|
| /arkcompiler/ets_frontend/es2panda/test/parser/ts/inline-property/ |
| D | inline-property4-expected.txt | 7 lda.str str1 9 lda.str str2 15 lda.str str_prop 17 lda.str str3 21 lda.str str5 25 lda.str str6 41 lda.str str4 43 lda.str computed2 45 lda.str str5 47 lda.str [all …]
|
| /arkcompiler/runtime_core/taihe/compiler/taihe/utils/ |
| D | exceptions.py | 48 def describe(self) -> str: 63 def describe(self) -> str: 74 token: str 77 def describe(self) -> str: 83 name: str 86 def describe(self) -> str: 92 name: str 95 def describe(self) -> str: 101 name: str 104 def describe(self) -> str: [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ets_test_suite/strings/ |
| D | string_compare_to.ets | 30 [ "A", "A", 0 ], // same str latin -> EQ 35 [ "AAA", "AAA", 0 ], // same 3c str -> EQ 36 [ "AAAA", "AAAA", 0 ], // same 4c str -> EQ 37 [ "AAAX", "AAAA", 1 ], // different 4c str -> GT 38 [ "AAAA", "AAAX", -1], // different 4c str -> LT 41 [ "AAAAX", "AAAAX", 0 ], // same 5c str -> EQ 42 [ "AAAAA", "AAAAX", -1], // same 5c str -> LT 43 [ "AAAAX", "AAAAA", 1 ], // same 5c str -> EQ 44 [ "AAAAX", "AAAAAAA", 1 ], // different str -> GT 45 [ "AAAAAAA", "AAAAX", -1 ], // different str -> LT [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ets_func_tests/std/core/ |
| D | StringlocaleCompare.ets | 17 let str:string = "5"; 18 assertEQ(str.localeCompare('3'), 1); 19 assertEQ(str.localeCompare('7'), -1); 20 assertEQ(str.localeCompare('5'), 0); 24 let str:string = "5"; 25 assertEQ(str.localeCompare('3', "zh-CN"), 1); 26 assertEQ(str.localeCompare('3', undefined), 1); 27 assertEQ(str.localeCompare('7', "zh-CN"), -1); 28 assertEQ(str.localeCompare('5', "zh-CN"), 0); 37 let str:string = "5"; [all …]
|
| /arkcompiler/ets_runtime/test/perform/string/ |
| D | string.js | 17 … const str = "The quick brown fox jumps over the lazy dog. If the dog reacted, was it really lazy?" constant 20 str.replace(/dog/g, 'monkey'); 30 const str = 'Apples are round, and apples are juicy.'; constant 33 str.replace(re, 'Christmas'); 54 const str = "Hello World. How are you doing?" constant 57 str.split(" ", 3); 65 const str = "The quick brown fox jumps over the lazy dog." constant 68 str.split(" "); 76 const str = "Harry Trump ;Fred Barney; Helen Rigby ; Bill Abel ;Chris Hand " constant 80 str.split(re); [all …]
|
| /arkcompiler/ets_frontend/es2panda/test/optimizer/ts/branch-elimination/projects/ts_ohmurl_project/ |
| D | test-import-exec-expected.pa.txt | 6 lda.str bundle 8 lda.str bundle 20 lda.str none 32 lda.str normalized-bundlename 44 lda.str normalized 46 lda.str normalized 56 lda.str string 72 lda.str package 74 lda.str package 143 lda.str none [all …]
|
| /arkcompiler/ets_runtime/ecmascript/mem/ |
| D | c_string.cpp | 25 long CStringToL(const CString &str) in CStringToL() argument 28 int64_t result = std::strtol(str.c_str(), &endPtr, DEC_BASE); in CStringToL() 29 ASSERT(!(result == 0 && str.c_str() == endPtr) && "CString argument is not long int"); in CStringToL() 33 int64_t CStringToLL(const CString &str) in CStringToLL() argument 36 int64_t result = std::strtoll(str.c_str(), &endPtr, DEC_BASE); in CStringToLL() 37 ASSERT(!(result == 0 && str.c_str() == endPtr) && "CString argument is not long long int"); in CStringToLL() 41 uint64_t CStringToULL(const CString &str) in CStringToULL() argument 44 uint64_t result = std::strtoull(str.c_str(), &endPtr, DEC_BASE); in CStringToULL() 45 …ASSERT(!(result == 0 && str.c_str() == endPtr) && "CString argument is not unsigned long long int"… in CStringToULL() 49 float CStringToF(const CString &str) in CStringToF() argument [all …]
|