Package org.nutz.lang.segment

Source Code of org.nutz.lang.segment.SegmentsTest

package org.nutz.lang.segment;

import static org.junit.Assert.*;

import org.junit.Test;
import org.nutz.lang.Lang;
import org.nutz.lang.util.Context;

public class SegmentsTest {

  @Test
  public void test_simple_replace() {
    String ptn = "1${A}2${B}3${C}4";
    Context context = Lang.context();
    context.set("B", "haha");
    String str = Segments.replace(ptn, context);

    assertEquals("1${A}2haha3${C}4", str);
  }

}
TOP

Related Classes of org.nutz.lang.segment.SegmentsTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.