32 lines
613 B
Go
32 lines
613 B
Go
|
package megauploader
|
||
|
|
||
|
import "testing"
|
||
|
|
||
|
func TestNoExtZero(t *testing.T) {
|
||
|
if newFileIncrement("foo").Increment(0) != "foo" {
|
||
|
t.Fail()
|
||
|
}
|
||
|
}
|
||
|
func TestNoExtMore(t *testing.T) {
|
||
|
if newFileIncrement("foo").Increment(1) != "foo-1" {
|
||
|
t.Fail()
|
||
|
}
|
||
|
if newFileIncrement("foo").Increment(2) != "foo-2" {
|
||
|
t.Fail()
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func TestExtZero(t *testing.T) {
|
||
|
if newFileIncrement("foo.ogg").Increment(0) != "foo.ogg" {
|
||
|
t.Fail()
|
||
|
}
|
||
|
}
|
||
|
func TestExtMore(t *testing.T) {
|
||
|
if newFileIncrement("foo.ogg").Increment(1) != "foo-1.ogg" {
|
||
|
t.Fail()
|
||
|
}
|
||
|
if newFileIncrement("foo.ogg").Increment(2) != "foo-2.ogg" {
|
||
|
t.Fail()
|
||
|
}
|
||
|
}
|