1
1
package parser
2
2
3
3
import (
4
+ "github.com/corbym/gocrest/has"
4
5
"github.com/corbym/gocrest/is"
5
6
"github.com/corbym/gocrest/then"
6
7
"testing"
@@ -13,12 +14,12 @@ func Test_betaflight_message_can_be_parsed__with_GOCREST(t *testing.T) {
13
14
info := ParseFirmwareInformation ("# Betaflight / SPRACINGF3EVO (SPEV) 3.4.0 Apr 17 2018 / 14:00:13 (b2c247d34) MSP API: 1.39" )
14
15
15
16
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 " ))
17
18
then .AssertThat (t , info .TargetDetail , is .EqualTo ("SPEV" ))
18
19
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 ))
22
23
}
23
24
24
25
func Test_parsing_multiple_lines_returns_first_hit__with_GOCREST (t * testing.T ) {
0 commit comments