Giter Club home page Giter Club logo

expressionevaluator's Introduction

Expression Evaluator

public void testEquals(){
    Check(true, "'A' == 'A'");
    Check(true, "B == b");
    Check(false, "A == b");
    checkThrows("'A' = 'A'");
}

public void testFloatAndInteger(){
    Check(true, "6999999 >= 6999987");
    Check(true, "699999.9 >= 699998.7");
    Check(true, "699999.9 >= 699998");

    Check(true, "6999999 <= 7999987");
    Check(true, "699999.9 <= 799998.7");
    Check(true, "699999.9 >= 799998");

    Check(true, "6999999 == 6999999");
    Check(true, "699999.9 == 6999999.9");

    checkThrows( "699999.9 == AA");
    checkThrows( "699999.9 !> A''A");
}

public void testNotEqual(){
    Check(false, "A != A");
    Check(false, "B != b");
    Check(true, "A != b");
}

public void testParenthesis(){
    Check(true, "(A == A)");
    Check(false, "((((((A!=A))))))");
    checkThrows("((A))");
}

public void testNegation(){
    Check(false, "!(A==A))");
    Check(true, "!!!(A!=A))");
}

public void testAnd(){
    Check(true, "A==A and B==b");
    Check(false, "A==A and B==''");
    Check(false, "A==B and C==D");
}

public void testOr(){
    Check(true, "A==A or B==b");
    Check(true, "A==A or B==''");
    Check(false, "A==B or C==D");
}

public void testPrecedence(){
    Check(true, "A==B and C==C or D==D");
    Check(false, "A==B and (C==C or D==D)");
}

public void testExtraJunk(){
    checkThrows("A == A == A");
}

expressionevaluator's People

Contributors

sairam14 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.