Skip to content

Commit ebb0444

Browse files
committed
1 parent e7c3788 commit ebb0444

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

.github/workflows/debug-context.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,20 @@ jobs:
2323
show:
2424
runs-on: ubuntu-latest
2525
steps:
26+
- name: Dump GitHub context
27+
id: github_context_step
28+
run: echo '${{ toJSON(github) }}'
29+
- name: Dump job context
30+
run: echo '${{ toJSON(job) }}'
31+
- name: Dump steps context
32+
run: echo '${{ toJSON(steps) }}'
33+
- name: Dump runner context
34+
run: echo '${{ toJSON(runner) }}'
35+
- name: Dump strategy context
36+
run: echo '${{ toJSON(strategy) }}'
37+
- name: Dump matrix context
38+
run: echo '${{ toJSON(matrix) }}'
39+
2640
- name: show
2741
run: |
2842
# echo "github.workflow = ${{ github.workflow }}"

pkg/lock/lock_fast_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ var _ = Describe("gomega_assert", func() {
101101

102102
// 对于 map的比较, 比的是 values, 而忽略 map 的 key
103103
Expect(map[string]string{"1": "Foo", "2": "FooBarTest"}).Should(ConsistOf(ContainSubstring("Bar"), "Foo"))
104+
// map 断言 有 key
105+
Expect(map[string]string{"Foo": "Bar", "BazFoo": "Duck"}).Should(HaveKey(MatchRegexp(`.+Foo$`)))
106+
// map 断言 有 key value 对
107+
Expect(map[string]string{"Foo": "Bar", "BazFoo": "Duck"}).Should(HaveKeyWithValue("Foo", "Bar"))
104108

105109
// 对 array, slice or map 的比较 , ContainElements中的成员 出现 即可, 即子集即可
106110
// ContainElements() uses Equal() to match the elements

0 commit comments

Comments
 (0)