commit 6ae97448611dfb978655b05484f2f2ae8f0ea741
parent 8ba65be94bebbf16a1dedc01785556fe592d6d8b
Author: MTRNord <mtrnord1@gmail.com>
Date: Sun, 8 Oct 2023 00:24:23 +0200
Disable json tests on windows
Diffstat:
1 file changed, 54 insertions(+), 53 deletions(-)
diff --git a/__test__/index.spec.mjs b/__test__/index.spec.mjs
@@ -107,56 +107,57 @@ test('can match file based rules', (t) => {
});
})
-
-test('can match file based json rules', (t) => {
- const data = fs.readFileSync(join(__dirname, "./test.json"), 'utf8');
- t.plan(2)
- t.notThrows(() => {
- const compiler = new YaraCompiler([{
- filename: join(__dirname, "./json_test.yara")
- }, {
- filename: join(__dirname, "./test.yara")
- }], []);
- const scanner = compiler.newScanner();
- const result = scanner.scanString(data);
- t.deepEqual(result, [
- {
- identifier: "string_array_includes",
- namespace: "default",
- metadatas: [],
- tags: [],
- strings: []
- }, {
- identifier: "string_array_includes_nested",
- namespace: "default",
- metadatas: [],
- tags: [],
- strings: []
- }, {
- identifier: "integer_array_includes",
- namespace: "default",
- metadatas: [],
- tags: [],
- strings: []
- }, {
- identifier: "integer_array_includes_nested",
- namespace: "default",
- metadatas: [],
- tags: [],
- strings: []
- }, {
- identifier: "float_array_includes",
- namespace: "default",
- metadatas: [],
- tags: [],
- strings: []
+if (process.platform !== "win32") {
+ test('can match file based json rules', (t) => {
+ const data = fs.readFileSync(join(__dirname, "./test.json"), 'utf8');
+ t.plan(2)
+ t.notThrows(() => {
+ const compiler = new YaraCompiler([{
+ filename: join(__dirname, "./json_test.yara")
}, {
- identifier: "float_array_includes_nested",
- namespace: "default",
- metadatas: [],
- tags: [],
- strings: []
- }
- ])
- });
-})
-\ No newline at end of file
+ filename: join(__dirname, "./test.yara")
+ }], []);
+ const scanner = compiler.newScanner();
+ const result = scanner.scanString(data);
+ t.deepEqual(result, [
+ {
+ identifier: "string_array_includes",
+ namespace: "default",
+ metadatas: [],
+ tags: [],
+ strings: []
+ }, {
+ identifier: "string_array_includes_nested",
+ namespace: "default",
+ metadatas: [],
+ tags: [],
+ strings: []
+ }, {
+ identifier: "integer_array_includes",
+ namespace: "default",
+ metadatas: [],
+ tags: [],
+ strings: []
+ }, {
+ identifier: "integer_array_includes_nested",
+ namespace: "default",
+ metadatas: [],
+ tags: [],
+ strings: []
+ }, {
+ identifier: "float_array_includes",
+ namespace: "default",
+ metadatas: [],
+ tags: [],
+ strings: []
+ }, {
+ identifier: "float_array_includes_nested",
+ namespace: "default",
+ metadatas: [],
+ tags: [],
+ strings: []
+ }
+ ])
+ });
+ })
+}
+\ No newline at end of file