Comments (6)
Possible workaround: use exceptions or assert instead of booleans to make the test fail
from rascal.
This is an excellent idea; and a duplicate of the ancient #1010
from rascal.
I think the compiler can just interpret the existing boolean operators differently. There is no need for an API like JUnit.assertEqual or something. If I write test f(int a, int b) = a + b == b + a
it is already clear that I am asserting that both sides of the ==
are equal.
from rascal.
I think the compiler can just interpret the existing boolean operators differently.
Yes, for equality that works perfectly. But depending on how complex the tests get, we are still in trouble:
- what do we do when only partial matches are relevant, for example in a string?
- what do we do if a test requires more than one comparison? For example, testing a list usually requires to check its size and its elements. Checking for equality would again merge both cases into one
from rascal.
There are limits with what we can do, indeed. However if we bring it up too the level of junit asserts, (equals, unequals, booleans) with proper diffs, we are already much richer than what we have now (false).
Also input minimisation (random or brute force or heuristically) would help a lot.
from rascal.
The next step would be to bring in a theory of pattern matching and parsing; i.e if a match fails we could explain why or produce a smaller test case that also fails for the same reason.
from rascal.
Related Issues (20)
- Interpreter does not support sub-typing for regular symbols with type parameters HOT 1
- analysis::grammars::LOC::countSLOC rather slow HOT 1
- CallFailed highlights the last/wrong parameter
- Syntax holes that range over regular expressions (except lists) do not parse correctly HOT 8
- Closely related ambiguities around character class combinators HOT 1
- Crash of type-checker when a module is not found HOT 1
- tuple labels lost when projecting constructor keyword field?? HOT 3
- TPL files are never binary compatible due to references based on exact source locations HOT 1
- Incomplete type inference for variable assigned in a for loop? HOT 1
- Inferred type for negatively matched variable is `void` HOT 1
- Strange spurious errors while "incrementally type-checking"? HOT 3
- [RELEASE] rascal-eclipse version 0.30.7
- Online yacc/lex grammar editor/tester HOT 3
- `|cwd:///|` should not be on the default search path of the interpreter HOT 1
- Review StandardLibraryContributor HOT 16
- lang::json::io::asJSON looses name of constructor in case it has arguments HOT 4
- What is the best way for the REPL to load modules from cwd? HOT 4
- Interesting exception during parsing HOT 4
- Keyword parameter default expression that does not fit declared type crashed without proper report HOT 1
- Incorrect location path is handled as existing HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rascal.