puppetlabs-toy-chest / wash

Wide Area SHell: a cloud-native shell for bringing remote infrastructure to your terminal.
https://puppetlabs.github.io/wash
Apache License 2.0
180 stars 29 forks source link

Refactor tests to be more representative of the real world #752

Closed ekinanp closed 4 years ago

ekinanp commented 4 years ago

Real-world RQL use involves unmarshaling the AST from JSON then calling the appropriate Eval methods. The values passed into value predicates are also unmarshaled JSON values. The unit tests should simulate these real-world scenarios. Thus, this commit modifies the helpers in asttest.Suite to ensure that JSON unmarshaled Go types are passed as input both for the ast and for value predicates.

Signed-off-by: Enis Inan enis.inan@puppet.com