INNER CODE UNIT · Go

TestLogDestinationForDatabase

oracle/oracle-db-appdev-monitoring · alertlog/alertlog_test.go:36

func TestLogDestinationForDatabase(t *testing.T) {
	t.Run("returns shared destination when disabled", func(t *testing.T) {
		got := logDestinationForDatabase("/log/alert.log", "db2", false)
		if got != "/log/alert.log" {
			t.Fatalf("expected shared destination, got %q", got)
		}
	})

	t.Run("inserts database name before extension", func(t *testing.T) {
		got := logDestinationForDatabase("/log/alert.log", "db2", true)
		if got != "/log/alert-db2.log" {
			t.Fatalf("expected per-database destination, got %q", got)
		}
	})

	t.Run("supports paths without extension", func(t *testing.T) {
		got := logDestinationForDatabase("/log/alert", "db2", true)
		if got != "/log/alert-db2" {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…