This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Commit ee57bcf
1 parent 9a987b8 commit ee57bcf Copy full SHA for ee57bcf
File tree 1 file changed +23
-0
lines changed
1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -94,6 +94,29 @@ test_object_cmd() {
94
94
test_cmp expected_putBroken actual_putBroken &&
95
95
test_cmp expected_putBrokenErr actual_putBrokenErr
96
96
'
97
+
98
+ test_expect_success " 'ipfs object patch' should work" '
99
+ EMPTY_DIR=$(ipfs object new unixfs-dir) &&
100
+ OUTPUT=$(ipfs object patch $EMPTY_DIR add-link foo $EMPTY_DIR)
101
+ '
102
+
103
+ test_expect_success " should have created dir within a dir" '
104
+ ipfs ls $OUTPUT > patched_output
105
+ '
106
+
107
+ test_expect_success " output looks good" '
108
+ echo "QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn 4 foo/ " > patched_exp &&
109
+ test_cmp patched_exp patched_output
110
+ '
111
+
112
+ test_expect_success " can remove the directory" '
113
+ ipfs object patch $OUTPUT rm-link foo > rmlink_output
114
+ '
115
+
116
+ test_expect_success " output should be empty" '
117
+ echo QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn > rmlink_exp &&
118
+ test_cmp rmlink_exp rmlink_output
119
+ '
97
120
}
98
121
99
122
# should work offline
You can’t perform that action at this time.
0 commit comments