Skip to content

Commit

Permalink
Move record to test
Browse files Browse the repository at this point in the history
  • Loading branch information
kahgoh committed Jul 14, 2024
1 parent 4583739 commit 84a0058
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 6 deletions.
3 changes: 0 additions & 3 deletions exercises/practice/knapsack/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
],
"example": [
".meta/example.lfe"
],
"editor": [
"include/item.lfe"
]
},
"blurb": "Given a knapsack that can only carry a certain weight, determine which items to put in the knapsack in order to maximize their combined value.",
Expand Down
2 changes: 1 addition & 1 deletion exercises/practice/knapsack/.meta/example.lfe
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(defmodule knapsack
(export (maximum-value 2)))

(include-lib "include/item.lfe")
(defrecord item weight value)

(defun find-max
(item last-values capacity)
Expand Down
1 change: 0 additions & 1 deletion exercises/practice/knapsack/include/item.lfe

This file was deleted.

3 changes: 2 additions & 1 deletion exercises/practice/knapsack/test/knapsack-tests.lfe
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
(behaviour ltest-unit)
(export all))

(include-lib "include/item.lfe")
(include-lib "ltest/include/ltest-macros.lfe")

(defrecord item weight value)

(deftest no-items
(is-equal 0 (knapsack:maximum-value '() 100)))

Expand Down

0 comments on commit 84a0058

Please sign in to comment.