@@ -2,6 +2,7 @@ package gguf_test
22
33import (
44 "encoding/json"
5+ "path"
56 "path/filepath"
67 "testing"
78
@@ -108,10 +109,15 @@ func TestGGUF(t *testing.T) {
108109 }
109110
110111 // Check for required annotation keys
111- if _ , ok := layer .Annotations [types .AnnotationFilePath ]; ! ok {
112+ filePath , ok := layer .Annotations [types .AnnotationFilePath ]
113+ if ! ok {
112114 t .Errorf ("Expected annotation %s to be present" , types .AnnotationFilePath )
113115 }
114116
117+ if filePath != path .Base ("dummy.gguf" ) {
118+ t .Errorf ("Expected file path annotation to be '%s', got '%s'" , path .Base ("dummy.gguf" ), filePath )
119+ }
120+
115121 if _ , ok := layer .Annotations [types .AnnotationFileMetadata ]; ! ok {
116122 t .Errorf ("Expected annotation %s to be present" , types .AnnotationFileMetadata )
117123 }
@@ -136,6 +142,21 @@ func TestGGUF(t *testing.T) {
136142 if metadata .Size == 0 {
137143 t .Error ("Expected file size to be non-zero" )
138144 }
145+ if metadata .Typeflag != 0 {
146+ t .Errorf ("Expected Typeflag 0 for regular file, got %d" , metadata .Typeflag )
147+ }
148+ if metadata .Mode == 0 {
149+ t .Error ("Expected file mode to be non-zero" )
150+ }
151+ if metadata .ModTime .IsZero () {
152+ t .Error ("Expected modification time to be set" )
153+ }
154+ if metadata .Uid != 0 {
155+ t .Error ("Expected Uid to be set with default 0" )
156+ }
157+ if metadata .Gid != 0 {
158+ t .Error ("Expected Gid to be set with default 0" )
159+ }
139160 })
140161 })
141162}
0 commit comments