diff options
| author | EuAndreh <eu@euandre.org> | 2025-12-05 19:57:18 -0300 |
|---|---|---|
| committer | EuAndreh <eu@euandre.org> | 2025-12-05 19:57:18 -0300 |
| commit | 30a25019a627e23ae6696455a280985f4844d9a8 (patch) | |
| tree | 4b825dc642cb6eb9a060e54bf8d69288fbee4904 /tests/functional/wait-after-publish/fiinha.go | |
| parent | Update to latest project skeleton: i18n and fine-grained fuzzing (diff) | |
| download | fiinha-30a25019a627e23ae6696455a280985f4844d9a8.tar.gz fiinha-30a25019a627e23ae6696455a280985f4844d9a8.tar.xz | |
rm -rf *: setup change to Clojure
Diffstat (limited to 'tests/functional/wait-after-publish/fiinha.go')
| -rw-r--r-- | tests/functional/wait-after-publish/fiinha.go | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/tests/functional/wait-after-publish/fiinha.go b/tests/functional/wait-after-publish/fiinha.go deleted file mode 100644 index 71b9b56..0000000 --- a/tests/functional/wait-after-publish/fiinha.go +++ /dev/null @@ -1,54 +0,0 @@ -package fiinha - -import ( - "runtime" - - "uuid" - g "gobang" -) - - - -const topic = "topic" - - - -func MainTest() { - _, file, _, ok := runtime.Caller(0) - g.TAssertEqualS(ok, true, "can't get filename") - - databasePath := file + ".db" - queue, err := New(databasePath) - g.TErrorIf(err) - defer queue.Close() - - pub := func(flowID uuid.UUID, payload []byte) { - unsent := UnsentMessage{ - Topic: topic, - FlowID: flowID, - Payload: payload, - } - _, err := queue.Publish(unsent) - g.TErrorIf(err) - } - - - g.Testing("we can WaitFor() a message before its publishing", func() { - flowID := uuid.New() - waiter := queue.WaitFor(topic, flowID, "waiter").Channel - - pub(flowID, []byte("payload before")) - - given := <- waiter - g.TAssertEqual(given, []byte("payload before")) - }) - - g.Testing("we can also do it after its publishing", func() { - flowID := uuid.New() - - pub(flowID, []byte("payload after")) - - given := <- queue.WaitFor(topic, flowID, "waiter").Channel - g.TAssertEqual(given, []byte("payload after")) - }) -} |
