Package dk.brics.string.stringoperations

Examples of dk.brics.string.stringoperations.AssertEquals


                if (lefttype.leastUpperBound(VariableType.NONE) != VariableType.NONE
                    && righttype.leastUpperBound(VariableType.NONE) != VariableType.NONE) {
                    Variable left = context.getExpressionVariable(v.getOp1());
                    Variable right = context.getExpressionVariable(v.getOp2());
                    if (equals == true) {
                        makeBinaryAssertion(left, right, new AssertEquals());
                        makeBinaryAssertion(right, left, new AssertEquals());
                        // assert aliases as well
                        if (lefttype.mightBeUsefulMutable() && righttype.mightBeUsefulMutable()) {
                          makeAliasAssertion(left, right, true);
                        }
                    }
View Full Code Here


            }
            else if (m.getSignature().equals("<java.lang.String: boolean equals(java.lang.Object)>")) {
                Variable base = getBase(v);
                Variable arg = getArgument(v, 0);
                if (expected == true) {
                    makeBinaryAssertion(base, arg, new AssertEquals());
                    makeBinaryAssertion(arg, base, new AssertEquals());
                } else {
                    makeBinaryAssertion(base, arg, new AssertNotEquals());
                    makeBinaryAssertion(arg, base, new AssertNotEquals());
                }
            }
            else if (m.getSignature().equals("<java.lang.String: boolean startsWith(java.lang.String)>")) {
                if (expected == true) {
                    Variable base = getBase(v);
                    Variable arg = getArgument(v, 0);
                    makeBinaryAssertion(base, arg, new AssertStartsWith());
                    makeBinaryAssertion(arg, base, new AssertPrefixOf());
                } else {
                    // TODO negated startsWith assertions [note: it is sound to ignore this]
                }
            }
            else if (m.getSignature().equals("<java.lang.String: boolean endsWith(java.lang.String)>")) {
                if (expected == true) {
                    Variable base = getBase(v);
                    Variable arg = getArgument(v, 0);
                    makeBinaryAssertion(base, arg, new AssertEndsWith());
                    makeBinaryAssertion(arg, base, new AssertSuffixOf());
                } else {
                    // TODO negated endsWith assertions [note: it is sound to ignore this]
                }
            }
            else if (m.getSignature().equals("<java.lang.String: boolean isEmpty()>")) {
                Variable base = getBase(v);
                if (expected == true) {
                    makeUnaryAssertion(base, new AssertEmpty());
                } else {
                    makeUnaryAssertion(base, new AssertNotEmpty());
                }
            }
            else if (m.getSignature().equals("<java.lang.String: boolean contentEquals(java.lang.StringBuffer)>")
                    || m.getSignature().equals("<java.lang.String: boolean contentEquals(java.lang.CharSequence)>")) {
                Variable base = getBase(v);
                Variable arg = getArgument(v, 0);
                if (expected == true) {
                    makeBinaryAssertion(base, arg, new AssertEquals());
                    makeBinaryAssertion(arg, base, new AssertEquals());
                } else {
                    makeBinaryAssertion(base, arg, new AssertNotEquals());
                    makeBinaryAssertion(arg, base, new AssertNotEquals());
                }
            }
View Full Code Here

TOP

Related Classes of dk.brics.string.stringoperations.AssertEquals

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.