diff --git a/InitialArkTSCorpus/README.md b/InitialArkTSCorpus/README.md new file mode 100644 index 0000000000000000000000000000000000000000..fb69546d4d13b610a8790bbb6370f173da36c13a --- /dev/null +++ b/InitialArkTSCorpus/README.md @@ -0,0 +1,12 @@ +# How To Extend Initial ArkTS Corpus + +This corpus is generated from ArkTS API examples: + +In order to extend the corpus please follow the steps: + +1. Convert the given TypeScript code with the help from playground. Use import line so the compiler understands that you are using the API extension and is able to produce JavaScript code. +2. Create a new `.js` file with this code in `InitialArkTSCorpus` folder. +3. Compile the given file to create corresponding `.fzil` program file (serialized `Program` class representation of FuzzIL program): `swift run FuzzILTool --compile ./InitialArkTSCorpus/.js` +4. Run fuzzing with importing of the initial ArkTS corpus. Provide the following options to FuzzilliCli: `--importCorpus=./InitialArkTSCorpus --corpusImportMode=full` + +The full mode means you do not need to either assess or minimize the provided programs. They will be fed to mutators as is. diff --git a/InitialArkTSCorpus/hashMapEmpty.fzil b/InitialArkTSCorpus/hashMapEmpty.fzil new file mode 100644 index 0000000000000000000000000000000000000000..be9ff5f4ceb0c394536d9f5545d30ca8581de5a1 Binary files /dev/null and b/InitialArkTSCorpus/hashMapEmpty.fzil differ diff --git a/InitialArkTSCorpus/hashMapEmpty.js b/InitialArkTSCorpus/hashMapEmpty.js new file mode 100644 index 0000000000000000000000000000000000000000..b7466bfb7a75106e00b70eb5260c9eba9ce8e95f --- /dev/null +++ b/InitialArkTSCorpus/hashMapEmpty.js @@ -0,0 +1,4 @@ +let arkPrivate = globalThis.ArkPrivate; +var HashMap = arkPrivate.Load(arkPrivate.HashMap); +const hashMap = new HashMap(); +let result = hashMap.isEmpty();