Fix tests
This commit is contained in:
parent
1b367d4dfb
commit
765decdd41
1099
src/parser.rs
1099
src/parser.rs
File diff suppressed because it is too large
Load Diff
@ -62,7 +62,7 @@ fn function_context_does_not_capture_values() {
|
||||
),
|
||||
Err(vec![Error::Validation {
|
||||
error: ValidationError::VariableNotFound(Identifier::new("x")),
|
||||
position: (0, 0)
|
||||
position: (0, 0).into()
|
||||
}])
|
||||
);
|
||||
|
||||
|
@ -141,10 +141,10 @@ fn map_type_errors() {
|
||||
actual: Type::String,
|
||||
expected: Type::Boolean
|
||||
},
|
||||
actual_position: (0, 0),
|
||||
expected_position: (0, 0),
|
||||
actual_position: (0, 0).into(),
|
||||
expected_position: (0, 0).into(),
|
||||
},
|
||||
position: (0, 22)
|
||||
position: (0, 22).into()
|
||||
}])
|
||||
);
|
||||
}
|
||||
|
@ -30,10 +30,10 @@ fn set_variable_with_type_error() {
|
||||
actual: Type::Boolean,
|
||||
expected: Type::String
|
||||
},
|
||||
actual_position: (0, 0),
|
||||
expected_position: (0, 0)
|
||||
actual_position: (0, 0).into(),
|
||||
expected_position: (0, 0).into()
|
||||
},
|
||||
position: (0, 18)
|
||||
position: (0, 18).into()
|
||||
}])
|
||||
);
|
||||
}
|
||||
@ -43,16 +43,13 @@ fn function_variable() {
|
||||
assert_eq!(
|
||||
interpret("foobar = (x: int): int { x }; foobar"),
|
||||
Ok(Some(Value::function(
|
||||
vec![(
|
||||
Identifier::new("x"),
|
||||
Type::Integer.with_position((0..0).into())
|
||||
)],
|
||||
Type::Integer.with_position((0..0).into()),
|
||||
vec![(Identifier::new("x"), Type::Integer.with_position((0, 0)))],
|
||||
Type::Integer.with_position((0, 0)),
|
||||
Block::new(vec![Statement::Expression(Expression::Identifier(
|
||||
Identifier::new("x")
|
||||
))
|
||||
.with_position((0..0).into())])
|
||||
.with_position((0..0).into())
|
||||
.with_position((0, 0))])
|
||||
.with_position((0, 0))
|
||||
)))
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user