Skip to content

Commit b2a8323

Browse files
committed
Add failing test for YUnicode reload
1 parent 3eb4dfd commit b2a8323

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/test_yunicode.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
from jupyter_ydoc import YUnicode
2+
3+
4+
def test_set_no_op_if_unchaged():
5+
text = YUnicode()
6+
text.set("test content")
7+
8+
changes = []
9+
10+
def record_changes(topic, event):
11+
changes.append((topic, event))
12+
13+
text.observe(record_changes)
14+
15+
model = text.get()
16+
17+
# Call set with identical text
18+
text.set(model)
19+
20+
# No changes should be observed at all
21+
assert changes == []

0 commit comments

Comments
 (0)