SwiftStudies / OysterKit

OysterKit is a framework that provides a native Swift scanning, lexical analysis, and parsing capabilities. In addition it provides a language that can be used to rapidly define the rules used by OysterKit called STLR
BSD 2-Clause "Simplified" License
178 stars 23 forks source link

Add tests for `RuleAnnotations+Description.swift` #97

Closed eimantas closed 6 years ago

eimantas commented 6 years ago

These tests check for a generated string for a single token (each token with each value type - 7x4). What needs to be done more is check for proper generation of multiple tokens from a single dinct. This is hard since dict keys are unsorted. To do this properly we'd need to sort the keys in description method (which would be solely for the purpose of the tests).

eimantas commented 6 years ago

Sounds good:

1) sort tokens with .custom pushed to the back; 2) sort .custom tokens based on alphabetical order;

eimantas commented 6 years ago

I'll prepare a separate PR for this then.

SwiftStudies commented 6 years ago

Sounds good

SwiftStudies commented 6 years ago

I've added the sort to the development 0.7 branch ready for tests 🙂

eimantas commented 6 years ago

How would you go about sorting two equal rule keys (e.g. @token("foobar") @token(42)?

SwiftStudies commented 6 years ago

Well the two will never exist in the same dictionary because the key is the same....