#if UNITY_6000_0_OR_NEWER using System.Collections; using NUnit.Framework; using UnityEngine; using UnityEngine.TestTools; using UnityEngine.UIElements; namespace UnityEditor.Searcher.Tests { // Regression coverage for UUM-146469. // // Unity PR #76495 ("white-space-standard") changed text handling so labels // collapse whitespace at label boundaries. SearcherHighlighter splits an item // name across multiple sibling Labels (one per highlighted/non-highlighted // run), so the space between runs lives at the start of a sibling Label — and // is stripped unless the label uses white-space: pre. // // Fix (Editor/Resources/Searcher.uss): white-space: pre on the labels-container // labels. Same shape as unity PR #83337's fix for the VFX filter window. public class SearcherLabelStyleTests { EditorWindow m_Window; [SetUp] public void SetUp() { m_Window = ScriptableObject.CreateInstance(); m_Window.ShowUtility(); } [TearDown] public void TearDown() { if (m_Window != null) m_Window.Close(); } [UnityTest] public IEnumerator LabelInLabelsContainer_ResolvesToWhiteSpacePre_FromSearcherStylesheet() { // Cloning SearcherItem.uxml pulls in Searcher.uss via