/*
 * Copyright 2020 Martin Winandy
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
 * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations under the License.
 */

package org.tinylog;

import org.junit.jupiter.api.Test;

import static org.assertj.core.api.Assertions.assertThat;

class LoggerTest {

	/**
	 * Verifies that the same logger instance is returned for the same tag.
	 */
	@Test
	void sameLoggerInstanceForSameTag() {
		TaggedLogger first = Logger.tag("foo");
		TaggedLogger second = Logger.tag("foo");
		assertThat(first).isNotNull().isSameAs(second);
	}

	/**
	 * Verifies that different logger instances are returned for different tags.
	 */
	@Test
	void differentLoggerInstanceForDifferentTag() {
		TaggedLogger first = Logger.tag("foo");
		TaggedLogger second = Logger.tag("boo");

		assertThat(first).isNotNull();
		assertThat(second).isNotNull();
		assertThat(first).isNotSameAs(second);
	}

}

@@ -1326,10 +1326,459 @@
 d);%0A%09%7D%0A%0A
+%09/**%0A%09 * Verifies that the same untagged root logger is returned for %7B@code null%7D and empty tags.%0A%09 */%0A%09@Test%0A%09void sameUntaggedRootLoggerForNullAndEmptyTags() %7B%0A%09%09TaggedLogger nullTag = Logger.tag(null);%0A%09%09TaggedLogger emptyTag = Logger.tag(%22%22);%0A%0A%09%09assertThat(nullTag).isNotNull();%0A%09%09assertThat(nullTag.getTag()).isNull();%0A%09%09assertThat(emptyTag).isNotNull();%0A%09%09assertThat(emptyTag.getTag()).isNull();%0A%0A%09%09assertThat(nullTag).isSameAs(emptyTag);%0A%09%7D%0A%0A
 %7D%0A

Add JUnit tests for receiving the untagged root logger