-
-
Notifications
You must be signed in to change notification settings - Fork 554
react: Move inputs (cells, operations) to input object #1130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
In the new schema in #1074, expected is REQUIRED. Since all expectations are encoded in the `operations` array, we just expect nothing. ```ruby operations = false ARGF.each_line { |l| operations ||= l.include?('"operations"') first_non_space = l.index(/\S/) if operations && l.strip == ?] l["\n"] = ",\n" puts l puts ' ' * first_non_space + '"expected": {}' operations = false else puts l end } ```
react 1.1.0 As proposed and accepted in #996 ```ruby indent = false operations = false ARGF.each_line { |l| if l.include?('version') ver = l.split(?")[3] ver_components = ver.split(?.).map(&:to_i) ver_components[1] += 1 ver_components[2] = 0 l[ver] = ver_components.join(?.) end first_non_space = l.index(/\S/) if l.include?('"cells"') puts ' ' * first_non_space + '"input": {' indent = true end operations ||= l.include?('"operations"') l.delete!(?,) if operations && l.strip == '],' puts "#{' ' if indent}#{l}" if operations && l.strip == ?] puts ' ' * first_non_space + '},' operations = false indent = false end } ```
], | ||
"operations": [ | ||
{ | ||
"type": "expect_cell_value", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In its current state, it is not possible to consistently place expect_cell_value
in expected
, so I do not.
], | ||
"operations": [ | ||
{ | ||
"type": "expect_cell_value", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this expect_cell_value
comes before a set_value
, therefore it is not possible to consistently place expect_cell_value
in expected
. Ordering is important. To place expect_cell_value
in expected
, we would need to redefine how expect_cell_value
works so that it may refer to a point in time before/after certain other operations
.
input object hamming 2.1.0 exercism/problem-specifications#1129 largest-series-product 1.1.0 exercism/problem-specifications#1114 leap 1.2.0 exercism/problem-specifications#1112 react 1.1.0 exercism/problem-specifications#1130 rna-transcription 1.2.0 exercism/problem-specifications#1111 sieve 1.1.0 exercism/problem-specifications#1105
input object hamming 2.1.0 exercism/problem-specifications#1129 largest-series-product 1.1.0 exercism/problem-specifications#1114 leap 1.2.0 exercism/problem-specifications#1112 react 1.1.0 exercism/problem-specifications#1130 rna-transcription 1.2.0 exercism/problem-specifications#1111 sieve 1.1.0 exercism/problem-specifications#1105
react 1.1.0
As proposed and accepted in #996
also note the additional commit that adds
"expected": {}
, since it's required but we expect nothing other than what was already expected inoperations
.