O'Reilly logo

Distributed Computing with Go by V.N. Nikhil Anurag

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Running tests

In api/feeder_test.go, we have three main test case scenarios:

  • To test if a unique hash is generated for each new document
  • Testing if payload sent to the /api/feeder endpoint returns document content as expected
  • Test to ensure the indexing of documents is working as expected

The following is the expected output after running the tests:

    $ go test -v ./...                                                 
    ?       github.com/last-ent/distributed-go/chapter6/goophr/concierge    [no test files]                                                                                      
    === RUN   TestGetTitleHash                 
    === RUN   TestGetTitleHash/Different_Titles                                           
    === RUN   TestGetTitleHash/Duplicate_Titles                                           
    === RUN   TestGetTitleHash/Same_hashes     
    --- PASS: TestGetTitleHash (0.00s)         
        --- PASS: TestGetTitleHash/Different_Titles (0.00s)                               
     --- PASS: TestGetTitleHash/Duplicate_Titles (0.00s) ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required