Exemplo n.º 1
0
    // Test a single operator.
    private void TestOp(JSScanner scanner, String ops,
                        ref int posn, JSToken expected)
    {
        Context token = JSScannerTest.TestGetTokenContext(scanner);

        scanner.GetNextToken();
        int    next   = ops.IndexOf(' ', posn);
        String thisop = ops.Substring(posn, next - posn);

        AssertEquals("TestOp[" + thisop + "] (1)",
                     expected, token.GetToken());
        AssertEquals("TestOp[" + thisop + "] (2)",
                     thisop, token.GetCode());
        AssertEquals("TestOp[" + thisop + "] (3)",
                     posn, token.StartPosition);
        AssertEquals("TestOp[" + thisop + "] (4)",
                     next, token.EndPosition);
        posn = next + 1;
    }
Exemplo n.º 2
0
	// Test a single operator.
	private void TestOp(JSScanner scanner, String ops,
					    ref int posn, JSToken expected)
			{
				Context token = JSScannerTest.TestGetTokenContext(scanner);
				scanner.GetNextToken();
				int next = ops.IndexOf(' ', posn);
				String thisop = ops.Substring(posn, next - posn);
				AssertEquals("TestOp[" + thisop + "] (1)",
							 expected, token.GetToken());
				AssertEquals("TestOp[" + thisop + "] (2)",
							 thisop, token.GetCode());
				AssertEquals("TestOp[" + thisop + "] (3)",
							 posn, token.StartPosition);
				AssertEquals("TestOp[" + thisop + "] (4)",
							 next, token.EndPosition);
				posn = next + 1;
			}