package com.alibaba.json.bvt.bug;

import junit.framework.TestCase;

import org.junit.Assert;

import com.alibaba.fastjson.parser.JSONScanner;

public class Issue119 extends TestCase {

    public void test_for_issue() throws Exception {
        JSONScanner lexer = new JSONScanner("-100S");
        lexer.resetStringPosition();
        lexer.scanNumber();
        Assert.assertEquals(Short.class, lexer.integerValue().getClass());
        Assert.assertEquals(-100, lexer.integerValue().shortValue());
        lexer.close();
    }
}

@@ -524,10 +524,317 @@
 ;%0A    %7D%0A
+    %0A    public void test_for_issue_b() throws Exception %7B%0A        JSONLexer lexer = new JSONLexer(%22-10B%22);%0A        lexer.scanNumber();%0A        Assert.assertEquals(Byte.class, lexer.integerValue().getClass());%0A        Assert.assertEquals(-10, lexer.integerValue().byteValue());%0A        lexer.close();%0A    %7D%0A
 %7D%0A

add testcase