Ver Fonte

x/model: add MapHash example

Blake Mizerany há 1 ano atrás
pai
commit
713e2feacf
1 ficheiros alterados com 12 adições e 0 exclusões
  1. 12 0
      x/model/name_test.go

+ 12 - 0
x/model/name_test.go

@@ -224,3 +224,15 @@ func ExampleMerge() {
 	// Output:
 	// registry.ollama.com/mistral:latest+Q4_0
 }
+
+func ExampleName_MapHash() {
+	m := map[uint64]bool{}
+
+	m[ParseName("mistral:latest+q4").MapHash()] = true
+	m[ParseName("miSTRal:latest+Q4").MapHash()] = true
+	m[ParseName("mistral:LATest+Q4").MapHash()] = true
+
+	fmt.Println(len(m))
+	// Output:
+	// 1
+}