11package parser
22
33import (
4+ "github.com/corbym/gocrest/has"
45 "github.com/corbym/gocrest/is"
56 "github.com/corbym/gocrest/then"
67 "testing"
@@ -13,12 +14,12 @@ func Test_betaflight_message_can_be_parsed__with_GOCREST(t *testing.T) {
1314 info := ParseFirmwareInformation ("# Betaflight / SPRACINGF3EVO (SPEV) 3.4.0 Apr 17 2018 / 14:00:13 (b2c247d34) MSP API: 1.39" )
1415
1516 then .AssertThat (t , info .FirmwareName , is .EqualTo ("Betaflight" ))
16- then .AssertThat (t , info .TargetName , is . EqualTo ( "SPRACINGF3EVO " ))
17+ then .AssertThat (t , info .TargetName , has . Prefix ( "SPRACING " ))
1718 then .AssertThat (t , info .TargetDetail , is .EqualTo ("SPEV" ))
1819 then .AssertThat (t , info .Version , is .GreaterThanOrEqualTo (int64 (3 )))
19- then .AssertThat (t , info .ReleaseDateStr , is .EqualTo ( "Apr 17 2018 " ))
20- then .AssertThat (t , info .ReleaseTime , is .EqualTo ( "14:00: 13" ))
21- then .AssertThat (t , info .GitHash , is . EqualTo ( "b2c247d34" ))
20+ then .AssertThat (t , info .ReleaseDateStr , is .EqualToIgnoringWhitespace ( "Apr172018 " ))
21+ then .AssertThat (t , info .ReleaseTime , is .AllOf ( has . Prefix ( "14" ), has . Suffix ( " 13") ))
22+ then .AssertThat (t , info .GitHash , has . Length ( 9 ))
2223}
2324
2425func Test_parsing_multiple_lines_returns_first_hit__with_GOCREST (t * testing.T ) {
0 commit comments