Learn how to verify the solutions with clojure.test.
- View Offline
- Exercise Files
- [Voiceover] Now that both the permutation and inductive…approaches have been implemented,…I'd like to verify them and test them against each other.…Inside of the test folder, I'm in the core test file.…I'll begin by defining a name space called queens.core-test.…Now our require expression, I'll pull in clojure.test…and I'll use refer, to pull in…just a few function's macros.…I'll pull in deftest and is.…Next, I'll require queens.permutation…and I'll just call that perm.…
And lastly, I'll pull in queens.inductive…and I'll alias that as ind.…To test our solutions; first I'll define an expected result.…I'll call this four queens solutions.…This will be the set of known good solutions…for a four by four board.…I'll use the hash brace to create a set,…then I'll create the vector, one three zero two,…and the vector, two zero three one.…Now I'll create a test using deftest.…
I'll name this test, test generate.…This will be our only test, so we…don't have to get too creative.…And I'll use is, to test the quality of the expected…
Skill Level Intermediate
1. Problem 1: Exploring Lake Pend Oreille
2. Problem 2: Image Analysis
3. Problem 3: Eight Queens
4. Problem 4: Accessing Peripherals
5. Problem 5: Recursion and Directories
6. Problem 6: Building the Web
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.