/*
 * Copyright (c) 2008-2018 The Aspectran Project
 *
 * 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 com.aspectran.shell.jline.console;

import org.junit.Test;

import java.io.IOException;

/**
 * <p>Created: 2017. 11. 19.</p>
 */
public class JLineAnsiStylerTest {

    @Test
    public void testAnsiColor() throws IOException {
        String s1 = "Ansi 8 colors {{white,bg:black}} Black {{black,bg:red}} Red {{white,bg:green}} Green {{black,bg:yellow}} Yellow {{bg:blue}} Blue {{bg:magenta}} Magenta {{bg:cyan}} Cyan {{black,bg:white}} White {{off}}";
        System.out.println(JLineAnsiStyler.parse(s1));
    }

}
@@ -827,64 +827,500 @@
 r() 
-throws IOException %7B%0A        String s1 = %22Ansi 8 colors 
+%7B%0A        String s0 = %22%7B%7Bblack%7D%7D Black %7B%7Bred%7D%7D Red %7B%7Bgreen%7D%7D Green %7B%7Byellow%7D%7D Yellow %7B%7Bblue%7D%7D Blue %7B%7Bmagenta%7D%7D Magenta %7B%7Bcyan%7D%7D Cyan %7B%7Bgray%7D%7D Gray %7B%7Boff%7D%7D%22;%0A        System.out.println(JLineAnsiStyler.parse(s0));%0A        String s1 = %22%7B%7BGRAY%7D%7D Bright Gray %7B%7BRED%7D%7D Bright Red %7B%7BGREEN%7D%7D Bright Green %7B%7BYELLOW%7D%7D Bright Yellow %7B%7BBLUE%7D%7D Bright Blue %7B%7BMAGENTA%7D%7D Bright Magenta %7B%7BCYAN%7D%7D Bright Cyan %7B%7Bwhite%7D%7D White %7B%7Boff%7D%7D%22;%0A        System.out.println(JLineAnsiStyler.parse(s1));%0A        String s2 = %22
 %7B%7Bwh
@@ -1330,25 +1330,25 @@
 ,bg:black%7D%7D 
-B
+b
 lack %7B%7Bblack
@@ -1353,25 +1353,25 @@
 ck,bg:red%7D%7D 
-R
+r
 ed %7B%7Bwhite,b
@@ -1376,25 +1376,25 @@
 ,bg:green%7D%7D 
-G
+g
 reen %7B%7Bblack
@@ -1398,33 +1398,33 @@
 ack,bg:yellow%7D%7D 
-Y
+y
 ellow %7B%7Bbg:blue%7D
@@ -1421,25 +1421,25 @@
 %7B%7Bbg:blue%7D%7D 
-B
+b
 lue %7B%7Bbg:mag
@@ -1437,33 +1437,33 @@
  %7B%7Bbg:magenta%7D%7D 
-M
+m
 agenta %7B%7Bbg:cyan
@@ -1461,25 +1461,25 @@
 %7B%7Bbg:cyan%7D%7D 
-C
+c
 yan %7B%7Bblack,
@@ -1481,25 +1481,237 @@
 lack,bg:
-white%7D%7D W
+gray%7D%7D gray  %7B%7Boff%7D%7D%5Cn%22 +%0A                    %22%7B%7Bwhite,bg:GRAY%7D%7D GRAY  %7B%7Bblack,bg:RED%7D%7D RED %7B%7Bwhite,bg:GREEN%7D%7D GREEN %7B%7Bblack,bg:YELLOW%7D%7D YELLOW %7B%7Bbg:BLUE%7D%7D BLUE %7B%7Bbg:MAGENTA%7D%7D MAGENTA %7B%7Bbg:CYAN%7D%7D CYAN %7B%7Bblack,bg:white%7D%7D w
 hite %7B%7Bo
@@ -1759,29 +1759,29 @@
 siStyler.parse(s
-1
+2
 ));%0A    %7D%0A%0A%7D

Update testcase