mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
parent
4d03b9fd98
commit
33616600e4
@ -44,6 +44,8 @@ func (s *Stream) Seek(offset int64, whence int) (int64, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Length returns the size of decoded stream in bytes.
|
// Length returns the size of decoded stream in bytes.
|
||||||
|
//
|
||||||
|
// If the source is not io.Seeker, Length returns 0.
|
||||||
func (s *Stream) Length() int64 {
|
func (s *Stream) Length() int64 {
|
||||||
return s.size
|
return s.size
|
||||||
}
|
}
|
||||||
|
@ -83,5 +83,10 @@ func TestNonSeeker(t *testing.T) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
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