Skip to content

Commit bc60f20

Browse files
committed
fixes typo and now actually testing detectavi
1 parent 73562f1 commit bc60f20

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/registry.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ function detectavi(io)
105105
seekstart(io)
106106
magic = ascii(read(io, UInt8, 4))
107107
magic == "RIFF" || return false
108-
seek(s, 8)
108+
seek(io, 8)
109109
submagic = ascii(read(io, UInt8, 4))
110110

111111
submagic == "AVI "

test/query.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,15 @@ context("Multiple Magic bytes") do
293293
end
294294
end
295295
context("AVI Detection") do
296+
open(joinpath(file_dir, "bees.avi")) do s
297+
@fact FileIO.detectavi(s) --> true
298+
end
299+
open(joinpath(file_dir, "sin.wav")) do s
300+
@fact FileIO.detectavi(s) --> false
301+
end
302+
open(joinpath(file_dir, "magic1.tiff")) do s
303+
@fact FileIO.detectavi(s) --> false
304+
end
296305
q = query(joinpath(file_dir, "bees.avi"))
297306
@fact typeof(q) --> File{format"AVI"}
298307
end

0 commit comments

Comments
 (0)