Skip to content
Snippets Groups Projects
Commit 4475cee0 authored by Igor Markin's avatar Igor Markin
Browse files

Add tets for RKA utility

parent 9feadd3b
Branches
Tags
1 merge request!35Fix spans unwinding
import { describe, it, expect } from "@jest/globals";
import { RKAUtility } from "../src";
describe("RKAUtility", () => {
it("performs string search using Rabin-Karp algorithm", async () => {
const originalString = "testreply";
const hash = RKAUtility.getRabinFingerprint(originalString);
const stringToSearchIn =
"testreply[image:qrcode.png]<https://gcloud-dev.vrgnservices.com/?q=CiBzo4Tb6V46VK_i0XGdEAnLDyuVh6WMQ3OjFZ6hS3cpLBIg5StsOWsJqWSzc-MtBvtBnyxz0LMKxEuP6tBY3yQDR30=&timestamp=1605520113253>OnMon,Nov16,2020at11:48AMZdravkoIliev<zdravko.iliev61@gmail.com>wrote:>newtesttest>[image:qrcode.png]>><https://gcloud-dev.vrgnservices.com/?q=CiDS9DmcKnlqUc-nEEjRCMYms9Puat9ZYQGdCVty6BhYABIgXnc1XhSGgzos0B21kZTbe7tAVPBiRo9VXMQFUNDpdpc=&timestamp=1605520082515>>";
const index = RKAUtility.searchFingerprintInText(
stringToSearchIn,
hash,
originalString.length
);
expect(index).toBeGreaterThan(-1);
});
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment