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();
    }
    
    public void test_for_issue_b() throws Exception {
        JSONLexer lexer = new JSONLexer("-10B");
        lexer.scanNumber();
        Assert.assertEquals(Byte.class, lexer.integerValue().getClass());
        Assert.assertEquals(-10, lexer.integerValue().byteValue());
        lexer.close();
    }
}

@@ -595,19 +595,21 @@
     JSON
-Lex
+Scann
 er lexer
@@ -623,11 +623,13 @@
 JSON
-Lex
+Scann
 er(%22

add testcase