1
0
mirror of https://github.com/gryf/tagbar.git synced 2025-12-18 03:50:26 +01:00

Add tests to repository

This commit is contained in:
Jan Larres
2013-03-28 00:16:03 +13:00
parent b6f47e4020
commit db9404ca1a
128 changed files with 54624 additions and 0 deletions

46
tests/java/FlowSet.java Normal file
View File

@@ -0,0 +1,46 @@
// This file is part of the Java Compiler Kit (JKit)
//
// The Java Compiler Kit is free software; you can
// redistribute it and/or modify it under the terms of the
// GNU General Public License as published by the Free Software
// Foundation; either version 2 of the License, or (at your
// option) any later version.
//
// The Java Compiler Kit is distributed in the hope
// that it will be useful, but WITHOUT ANY WARRANTY; without
// even the implied warranty of MERCHANTABILITY or FITNESS FOR
// A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public
// License along with the Java Compiler Kit; if not,
// write to the Free Software Foundation, Inc., 59 Temple Place,
// Suite 330, Boston, MA 02111-1307 USA
//
// (C) David James Pearce, 2009.
package jkit.jil.dfa;
public interface FlowSet {
/**
* FlowSets must be cloneable to facilitate multiple flows of execution
* from conditionals
*
* @return A Clone of the current FlowSet
*/
public Object clone();
/**
* Computes the least upper bound of this flowset and that provided. <b>NOTE</b>
* the join operation has a subtle, yet important, requirement. If the
* result of the join must be equivalent to *this* flowset, then it must be
* the *same* flowset.
*
* @param s
* Another FlowSet to join with this
* @return true if this FlowSet has changed due to the computation, false
* otherwise
*/
public FlowSet join(FlowSet s);
}

1933
tests/java/JilBuilder.java Normal file

File diff suppressed because it is too large Load Diff

40
tests/java/ShipSquare.java Executable file
View File

@@ -0,0 +1,40 @@
import javax.swing.ImageIcon;
/**
* A Ship square represents a square that contains a battle ship, but has not
* yet been bombed. Ship Squares can be either visible or invisible (depending
* on which side they are).
*
* @author djp
*/
public class ShipSquare extends GridSquare {
private BattleShip ship;
private Type type;
public enum Type {
VERTICAL_TOP_END,
HORIZONTAL_MIDDLE
};
/**
* Construct a ShipSquare representing part of a battle ship (either a
* middle or end piece).
*
*/
public ShipSquare(Type type, BattleShip ship) {
this.type = type;
this.ship = ship;
}
/**
* Get the ship that this square is part of.
* @return
*/
public BattleShip getShip() { return ship; }
/**
* Determine what part of the ship this piece represents.
* @return
*/
public Type getType() { return type; }
}