Skip to content

Commit 79b8742

Browse files
committed
fix example test: on travis the output is differnt
Sometime it outputs `written: Vi64:5 ;` sometimes `written: Vi64:5;`. Solution: do not output Value, but instead output Value.Vi64
1 parent f7e9559 commit 79b8742

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Diff for: paxoskv/example_set_get_test.go

+8-8
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func Example_setAndGetByKeyVer() {
2727
Bal: &BallotNum{N: 0, ProposerId: 2},
2828
}
2929
v := prop.RunPaxos(acceptorIds, &Value{Vi64: 5})
30-
fmt.Printf("written: %v;\n", v)
30+
fmt.Printf("written: %v;\n", v.Vi64)
3131
}
3232

3333
// get foo₀
@@ -40,7 +40,7 @@ func Example_setAndGetByKeyVer() {
4040
Bal: &BallotNum{N: 0, ProposerId: 2},
4141
}
4242
v := prop.RunPaxos(acceptorIds, nil)
43-
fmt.Printf("read: %v;\n", v)
43+
fmt.Printf("read: %v;\n", v.Vi64)
4444
}
4545

4646
// set foo₁ = 6
@@ -53,7 +53,7 @@ func Example_setAndGetByKeyVer() {
5353
Bal: &BallotNum{N: 0, ProposerId: 2},
5454
}
5555
v := prop.RunPaxos(acceptorIds, &Value{Vi64: 6})
56-
fmt.Printf("written: %v;\n", v)
56+
fmt.Printf("written: %v;\n", v.Vi64)
5757
}
5858

5959
// get foo₁
@@ -66,13 +66,13 @@ func Example_setAndGetByKeyVer() {
6666
Bal: &BallotNum{N: 0, ProposerId: 2},
6767
}
6868
v := prop.RunPaxos(acceptorIds, nil)
69-
fmt.Printf("read: %v;\n", v)
69+
fmt.Printf("read: %v;\n", v.Vi64)
7070
}
7171

7272
// Output:
73-
// written: Vi64:5 ;
74-
// read: Vi64:5 ;
75-
// written: Vi64:6 ;
76-
// read: Vi64:6 ;
73+
// written: 5;
74+
// read: 5;
75+
// written: 6;
76+
// read: 6;
7777

7878
}

0 commit comments

Comments
 (0)