aboutsummaryrefslogtreecommitdiffstats
path: root/src/.jshintrc
blob: 1ba47a2617126c879640564f35267c4ac38c2d94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{
	"boss": true,
	"curly": true,
	"eqeqeq": true,
	"eqnull": true,
	"expr": true,
	"immed": true,
	"noarg": true,
	"quotmark": "double",
	"undef": true,
	"unused": true,

	"evil": true,
	"sub": true,

	// Support: IE < 10, Android < 4.1
	// The above browsers are failing a lot of tests in the ES5
	// test suite at http://test262.ecmascript.org.
	"es3": true,

	"globals": {
		"window": true,
		"JSON": false,

		"jQuery": true,
		"define": false,
		"module": false,
		"noGlobal": true
	}
}
ic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/*
 * Copyright (c) 1998-2002 PARC Inc.  All rights reserved.
 *
 * Use and copying of this software and preparation of derivative works based
 * upon this software are permitted.  Any distribution of this software or
 * derivative works must comply with all applicable United States export
 * control laws.
 *
 * This software is made available AS IS, and PARC Inc. makes no
 * warranty about the software, its performance or its conformity to any
 * specification.
 */

import java.util.*;
import java.io.*;

import org.aspectj.lang.*;

/** @author Wes Isberg */
public aspect BufferTest {

    // article page 43 - input driver
    // START-SAMPLE testing-inoculated-proceedVariants Using around for integration testing
    /**
     * When PrinterBuffer.capacity(int) is called,
     * test it with repeatedly with a set of input
     * (validating the result) and then continue with
     * the original call.
     *
     * This assumes that the capacity method causes no
     * relevant state changes in the buffer.
     */
    int around(int original, PrinterBuffer buffer) : 
        call(int PrinterBuffer.capacity(int)) && args(original) && target(buffer) {
        int[] input = new int[] { 0, 1, 10, 1000, -1, 4096 };
        for (int i = 0; i < input.length; i++) {
            int result = proceed(input[i], buffer); // invoke test
            validateResult(buffer, input[i], result);
        }
        return proceed(original, buffer);           // continue with original processing
    }
    // END-SAMPLE testing-inoculated-proceedVariants

    void validateResult(PrinterBuffer buffer, int input, int result) {
        System.err.println("validating input=" + input + " result=" + result
                           + " buffer=" + buffer);
    }

    public static void main(String[] args) {
        PrinterBuffer p = new PrinterBuffer();
        int i = p.capacity(0);
        System.err.println("main - result " + i);
    }
} 

class PrinterBuffer {
    int capacity(int i) {
        System.err.println("capacity " + i);
        return i;
    }
}