mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
parent
5bc1460648
commit
071d96f16d
@ -44,6 +44,8 @@ func (s *Stream) Seek(offset int64, whence int) (int64, error) {
|
||||
}
|
||||
|
||||
// Length returns the size of decoded stream in bytes.
|
||||
//
|
||||
// If the source is not io.Seeker, Length returns 0.
|
||||
func (s *Stream) Length() int64 {
|
||||
return s.size
|
||||
}
|
||||
|
@ -83,5 +83,10 @@ func TestNonSeeker(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
_ = s
|
||||
|
||||
got := s.Length()
|
||||
want := int64(0)
|
||||
if got != want {
|
||||
t.Errorf("s.Length(): got: %d, want: %d", got, want)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user