Skip to content

Commit 487d935

Browse files
committed
Add test for javascrip and typescript parser
Signed-off-by: Keshav Priyadarshi <git@keshav.space>
1 parent 400b72b commit 487d935

14 files changed

+665
-10
lines changed
File renamed without changes.

tests/data/symbols_tree_sitter/LibraryTypeOptionsDto.cs renamed to tests/data/symbols_tree_sitter/c-sharp/LibraryTypeOptionsDto.cs

File renamed without changes.

tests/data/symbols_tree_sitter/LibraryTypeOptionsDto.cs-expected.json renamed to tests/data/symbols_tree_sitter/c-sharp/LibraryTypeOptionsDto.cs-expected.json

File renamed without changes.

tests/data/symbols_tree_sitter/if_ath.c-expected.json renamed to tests/data/symbols_tree_sitter/c/if_ath.c-expected.json

File renamed without changes.
File renamed without changes.

tests/data/symbols_tree_sitter/test3.cpp-expected.json renamed to tests/data/symbols_tree_sitter/cpp/test3.cpp-expected.json

File renamed without changes.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Set the possible characters for the password
2+
const charSet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!@#$%^&*()_-+=";
3+
4+
// Function to generate a random password
5+
function generatePassword(length) {
6+
let password = "";
7+
for (let i = 0; i < length; i++) {
8+
// Choose a random character from the character set
9+
const randomIndex = Math.floor(Math.random() * charSet.length);
10+
const randomChar = charSet[randomIndex];
11+
// Add the random character to the password string
12+
password += randomChar;
13+
}
14+
return password;
15+
}
16+
17+
// Get the password length from the user
18+
const passwordLength = parseInt(prompt("Enter the desired length of your password:"));
19+
20+
// Generate the password and display it to the user
21+
const password = generatePassword(passwordLength);
22+
alert(`Your random password is: ${password}`);
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"files": [
3+
{
4+
"path": "main.js",
5+
"type": "file",
6+
"source_symbols": [
7+
"charSet",
8+
"generatePassword",
9+
"length",
10+
"password",
11+
"i",
12+
"i",
13+
"length",
14+
"i",
15+
"randomIndex",
16+
"Math",
17+
"Math",
18+
"charSet",
19+
"randomChar",
20+
"charSet",
21+
"randomIndex",
22+
"password",
23+
"randomChar",
24+
"password",
25+
"passwordLength",
26+
"parseInt",
27+
"prompt",
28+
"password",
29+
"generatePassword",
30+
"passwordLength",
31+
"alert",
32+
"password"
33+
],
34+
"source_strings": [
35+
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!@#$%^&*()_-+=",
36+
"Enter the desired length of your password:",
37+
"Your random password is: "
38+
],
39+
"scan_errors": []
40+
}
41+
]
42+
}

tests/data/symbols_tree_sitter/BrazeSDKAuthDelegateWrapper.m renamed to tests/data/symbols_tree_sitter/objective-c/BrazeSDKAuthDelegateWrapper.m

File renamed without changes.

0 commit comments

Comments
 (0)