Skip to content

Commit 565d725

Browse files
update conf with full names for Year, Month and Date
1 parent ac7daa0 commit 565d725

76 files changed

Lines changed: 221 additions & 220 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

validator/gen-validator-tests/conf.pb.go

Lines changed: 41 additions & 40 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

validator/gen-validator-tests/conf.proto

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ option go_package = "github.com/katydid/validator-testsuite/validator/gen-valida
77
// ideas for field names gathered from https://conferenceindex.org
88

99
message Conf {
10-
optional string N = 1; // name
10+
optional string Name = 1; // name
1111
optional date Due = 2; // submission deadline
1212
optional date Notify = 3; // notification
1313
optional location Loc = 4; // location
@@ -16,9 +16,9 @@ message Conf {
1616
}
1717

1818
message date {
19-
optional string Y = 1; // 4 digit year
20-
optional string M = 2; // 2 digit month
21-
optional string D = 3; // 2 digit day
19+
optional string Year = 1; // 4 digit year
20+
optional string Month = 2; // 2 digit month
21+
optional string Day = 3; // 2 digit day
2222
}
2323

2424
message location {

validator/gen-validator-tests/conf_benches.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func RandomValidDate(r *rand.Rand) *Date {
2626
year := fmt.Sprintf("%d", 2000+r.Intn(100))
2727
month := fmt.Sprintf("%02d\n", 1+r.Intn(12))
2828
day := fmt.Sprintf("%02d\n", 1+r.Intn(30))
29-
return &Date{Y: proto.String(year), M: proto.String(month), D: proto.String(day)}
29+
return &Date{Year: proto.String(year), Month: proto.String(month), Day: proto.String(day)}
3030
}
3131

3232
func RandomValidLocation(r *rand.Rand) *Location {
@@ -56,13 +56,13 @@ func RandomConf2026(r *rand.Rand) ProtoMessage {
5656
log.Printf("random looped: RandomValidConf")
5757
c = RandomValidConf(r).(*Conf)
5858
}
59-
c.Due.Y = proto.String("2026")
59+
c.Due.Year = proto.String("2026")
6060
return c
6161
}
6262

6363
func RandomConfNot2026(r *rand.Rand) ProtoMessage {
6464
c := RandomValidConf(r).(*Conf)
65-
for c.GetDue().GetY() == "2026" {
65+
for c.GetDue().GetYear() == "2026" {
6666
log.Printf("random looped: RandomValidConf")
6767
c = RandomValidConf(r).(*Conf)
6868
}
@@ -77,14 +77,14 @@ func RandomConfIsIn2026OrLate2025AndEU(r *rand.Rand) ProtoMessage {
7777
c = RandomValidConf(r).(*Conf)
7878
}
7979
if r.Intn(2) == 0 {
80-
c.Due.Y = proto.String("2026")
80+
c.Due.Year = proto.String("2026")
8181
} else {
82-
c.Due.Y = proto.String("2025")
82+
c.Due.Year = proto.String("2025")
8383
switch r.Intn(2) {
8484
case 0:
85-
c.Due.M = proto.String("11")
85+
c.Due.Month = proto.String("11")
8686
case 1:
87-
c.Due.M = proto.String("12")
87+
c.Due.Month = proto.String("12")
8888
}
8989
}
9090
c.Loc.Cont = proto.String("EU")

validator/gen-validator-tests/conf_tests.go

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,55 +19,55 @@ import (
1919
"google.golang.org/protobuf/proto"
2020
)
2121

22-
var ConfIsIn2026 = G{"main": InPath("Due", InPath("Y", Value(Eq(StringVar(), StringConst("2026")))))}
22+
var ConfIsIn2026 = G{"main": InPath("Due", InPath("Year", Value(Eq(StringVar(), StringConst("2026")))))}
2323

2424
var ConfITP2026 = &Conf{
25-
N: proto.String("ITP"),
25+
Name: proto.String("ITP"),
2626
Due: &Date{
27-
Y: proto.String("2026"),
27+
Year: proto.String("2026"),
2828
},
2929
}
3030

3131
var ConfICFP2017 = &Conf{
32-
N: proto.String("ICFP"),
32+
Name: proto.String("ICFP"),
3333
Due: &Date{
34-
Y: proto.String("2017"),
34+
Year: proto.String("2017"),
3535
},
3636
}
3737

3838
var ConfIsIn2026OrLate2025 = G{"main": InPath("Due",
3939
AnyOf(
40-
InPath("Y", Value(Eq(StringVar(), StringConst("2026")))),
40+
InPath("Year", Value(Eq(StringVar(), StringConst("2026")))),
4141
AllOf(
42-
InPath("Y", Value(Eq(StringVar(), StringConst("2025")))),
43-
InPath("M", Value(GE(StringVar(), StringConst("10")))),
42+
InPath("Year", Value(Eq(StringVar(), StringConst("2025")))),
43+
InPath("Month", Value(GE(StringVar(), StringConst("10")))),
4444
),
4545
),
4646
)}
4747

4848
var ConfITPLate2025 = &Conf{
49-
N: proto.String("ITP"),
49+
Name: proto.String("ITP"),
5050
Due: &Date{
51-
Y: proto.String("2025"),
52-
M: proto.String("11"),
51+
Year: proto.String("2025"),
52+
Month: proto.String("11"),
5353
},
5454
}
5555

5656
var ConfITPEarly2025 = &Conf{
57-
N: proto.String("ITP"),
57+
Name: proto.String("ITP"),
5858
Due: &Date{
59-
Y: proto.String("2025"),
60-
M: proto.String("04"),
59+
Year: proto.String("2025"),
60+
Month: proto.String("04"),
6161
},
6262
}
6363

6464
var ConfIsIn2026OrLate2025AndEU = G{"main": InAnyOrder(
6565
In("Due",
6666
AnyOf(
67-
InPath("Y", Value(Eq(StringVar(), StringConst("2026")))),
67+
InPath("Year", Value(Eq(StringVar(), StringConst("2026")))),
6868
AllOf(
69-
InPath("Y", Value(Eq(StringVar(), StringConst("2025")))),
70-
InPath("M", Value(GE(StringVar(), StringConst("10")))),
69+
InPath("Year", Value(Eq(StringVar(), StringConst("2025")))),
70+
InPath("Month", Value(GE(StringVar(), StringConst("10")))),
7171
),
7272
),
7373
),
@@ -78,20 +78,20 @@ var ConfIsIn2026OrLate2025AndEU = G{"main": InAnyOrder(
7878
)}
7979

8080
var ConfITPEU = &Conf{
81-
N: proto.String("ITP"),
81+
Name: proto.String("ITP"),
8282
Due: &Date{
83-
Y: proto.String("2025"),
84-
M: proto.String("11"),
83+
Year: proto.String("2025"),
84+
Month: proto.String("11"),
8585
},
8686
Loc: &Location{
8787
Cont: proto.String("EU"),
8888
},
8989
}
9090

9191
var ConfITPNotEU = &Conf{
92-
N: proto.String("ITP"),
92+
Name: proto.String("ITP"),
9393
Due: &Date{
94-
Y: proto.String("2026"),
94+
Year: proto.String("2026"),
9595
},
9696
Loc: &Location{
9797
Cont: proto.String("AF"),
@@ -101,12 +101,12 @@ var ConfITPNotEU = &Conf{
101101
var ConfIsComputerScience = G{"main": InPath("Category", Value(Eq(StringVar(), StringConst("Computer Science"))))}
102102

103103
var ConfComputerScience = &Conf{
104-
N: proto.String("ICFP"),
104+
Name: proto.String("ICFP"),
105105
Category: proto.String("Computer Science"),
106106
}
107107

108108
var ConfNotComputerScience = &Conf{
109-
N: proto.String("ICFP"),
109+
Name: proto.String("ICFP"),
110110
Category: proto.String("Functional Programming"),
111111
}
112112

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"N": "ICFP",
2+
"Name": "ICFP",
33
"Category": "Computer Science"
44
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"N": "ICFP",
2+
"Name": "ICFP",
33
"Category": "Functional Programming"
44
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"N": "ICFP",
2+
"Name": "ICFP",
33
"Due": {
4-
"Y": "2017"
4+
"Year": "2017"
55
}
66
}

validator/tests/goreflect/ConfIsIn2026ICFP2017/validator.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"TreeNode": {
2424
"Name": {
2525
"Name": {
26-
"StringValue": "Y"
26+
"StringValue": "Year"
2727
}
2828
},
2929
"Colon": {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
.Due:.Y:=="2026"
1+
.Due:.Year:=="2026"

validator/tests/goreflect/ConfIsIn2026ICFP2017/validator.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<TreeNode>
2525
<Name>
2626
<Name>
27-
<StringValue>Y</StringValue>
27+
<StringValue>Year</StringValue>
2828
<BytesValue></BytesValue>
2929
</Name>
3030
</Name>

0 commit comments

Comments
 (0)