Comments (2)
An alternative is using YAML anchors and merge keys:
- unit: 'Sum of three cubes'
definitions:
sum_of_three: &sum_of_three
oracle: 'custom_check'
language: 'python'
name: 'sum_of_three_cubes'
file: 'oracle.py'
testcases:
- stdin: '3'
stdout:
<<: *sum_of_three
data: |
1
1
1
- stdin: '33'
stdout: |
8866128975287528
-8778405442862239
-2736111468807040
- stdin: '42'
- stdout:
<<: *sum_of_three
data: |
-80538738812075974
80435758145817515
12602123297335631
I think this has some advantages:
- It is very explicit that the oracle config comes from something else.
- It is opt-in for all cases (no implicit inheritance)
- It is very flexible
As a disadvantage:
- It is more verbose, as you need to specify it everywhere.
This requires minimal changes to our JSON Schema, and no changes to our implementation, as this happens in the YAML parser.
from universal-judge.
If we should decide to use this (I am in favour), I would propose to also remove the existing configuration inheritance mechanism and always use YAML merge tags.
Another disavantage is that YAML merge tags are technically not part of YAML 1.2 or later, only 1.1 (but our Python YAML parser only supports 1.1, so I'm not sure it is a big disadvantage: this construct is used in the wild, so it won't disappear quickly).
from universal-judge.
Related Issues (20)
- Fetch stdin from file as an alternative to inlining it into test suite HOT 1
- Do not quote options on bash command lines generated by TESTed
- Support tests for files
- Generate "final" variables if possible
- Show stdin as a separate channel when used in combination with arguments HOT 2
- Closing newline insertion HOT 1
- Specify interface that must be implemented
- Link bash compilation error to corresponding line in code
- Support before/after in DSL
- Support attribute assignment
- Testing stdin/stdout and expressions at the same time? HOT 3
- Update node.js to latest version HOT 3
- JavaScript: consider alternative ways to create object as alternatives HOT 1
- Bug with Javascript objects
- representation of Set and Map as return value HOT 3
- Add some extra tests for the set/map type restrictions
- Bump JavaScript exercises repo commit in tests
- Dodona features for language-agnostic exercices
- Measure/estimate complexity (time and memory) HOT 2
- Testing usage of specific keywords?
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 universal-judge.