From c9ba7f337f491956599ac3fdd10cbe83275135cf Mon Sep 17 00:00:00 2001 From: Tim Date: Tue, 21 Nov 2023 12:36:33 -0800 Subject: [PATCH] added example test for mash usage. (#404) --- mash/example_test.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 mash/example_test.go diff --git a/mash/example_test.go b/mash/example_test.go new file mode 100644 index 000000000..48743a721 --- /dev/null +++ b/mash/example_test.go @@ -0,0 +1,22 @@ +package mash_test + +import ( + "fmt" + + "github.com/TimothyStiles/poly/mash" +) + +func ExampleMash() { + fingerprint1 := mash.New(17, 10) + fingerprint1.Sketch("ATGCGATCGATCGATCGATCGATCGATCGATCGATCGATCGATCGATCGATCGATCGATCGA") + + fingerprint2 := mash.New(17, 9) + fingerprint2.Sketch("ATGCGATCGATCGATCGATCGATCGATCGATCGATCGATCGATCGATCGATCGATCGATCGA") + + distance := fingerprint1.Distance(fingerprint2) + + fmt.Println(distance) + + // Output: + // 0 +}