mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
885ee160c2
Examples: 1) -metricsAuthKey=file:///abs/path/to/file - reads flag value from the given absolute filepath 2) -metricsAuthKey=file://./relative/path/to/file - reads flag value from the given relative filepath 3) -metricsAuthKey=http://some-host/some/path?query_arg=abc - reads flag value from the given url The flag value is automatically updated when the file contents changes.
24 lines
513 B
Go
24 lines
513 B
Go
package fs
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestIsTemporaryFileName(t *testing.T) {
|
|
f := func(s string, resultExpected bool) {
|
|
t.Helper()
|
|
result := IsTemporaryFileName(s)
|
|
if result != resultExpected {
|
|
t.Fatalf("unexpected IsTemporaryFileName(%q); got %v; want %v", s, result, resultExpected)
|
|
}
|
|
}
|
|
f("", false)
|
|
f(".", false)
|
|
f(".tmp", false)
|
|
f("tmp.123", false)
|
|
f(".tmp.123.xx", false)
|
|
f(".tmp.1", true)
|
|
f("asdf.dff.tmp.123", true)
|
|
f("asdf.sdfds.tmp.dfd", false)
|
|
f("dfd.sdfds.dfds.1232", false)
|
|
}
|