/*
 * Copyright The OpenTelemetry Authors
 * SPDX-License-Identifier: Apache-2.0
 */

package io.opentelemetry.api.internal;

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

import org.junit.jupiter.api.Test;

class StringUtilsTest {

  @Test
  void isPrintableString() {
    assertThat(StringUtils.isPrintableString("abcd")).isTrue();
    assertThat(StringUtils.isPrintableString("\2ab\3cd")).isFalse();
  }
}

@@ -412,11 +412,603 @@
 e();%0A  %7D
+%0A%0A  @Test%0A  void isValidMetricName() %7B%0A    assertThat(StringUtils.isValidMetricName(%22%22)).isFalse();%0A    assertThat(%0A            StringUtils.isValidMetricName(%0A                String.valueOf(new char%5BStringUtils.METRIC_NAME_MAX_LENGTH + 1%5D)))%0A        .isFalse();%0A    assertThat(StringUtils.isValidMetricName(%22abcd%22)).isTrue();%0A    assertThat(StringUtils.isValidMetricName(%22ab.cd%22)).isTrue();%0A    assertThat(StringUtils.isValidMetricName(%22ab12cd%22)).isTrue();%0A    assertThat(StringUtils.isValidMetricName(%221abcd%22)).isFalse();%0A    assertThat(StringUtils.isValidMetricName(%22ab*cd%22)).isFalse();%0A  %7D
 %0A%7D%0A

Add unit tests for isValidMetricName (#2218)