Skip to content

Commit 8c88bd3

Browse files
committed
additional thought stream tests
1 parent d6619c4 commit 8c88bd3

File tree

2 files changed

+66
-1
lines changed

2 files changed

+66
-1
lines changed

app/src/Outlander/Handlers/CommandProcessor.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class CommandProcesssor {
6363
handlers.append(MacroCommandHandler(files))
6464
handlers.append(LayoutCommandHandler(files))
6565
// for local testing only
66-
handlers.append(EmulateTextCommandHandler(files))
66+
// handlers.append(EmulateTextCommandHandler(files))
6767

6868
self.pluginManager = pluginManager
6969
}

app/src/OutlanderTests/GameStreamTests.swift

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,71 @@ class GameStreamTests: XCTestCase {
286286
XCTFail()
287287
}
288288
}
289+
290+
func test_combines_thoughts_stream() {
291+
let commands = streamCommands([
292+
"<pushStream id=\"thoughts\"/><preset id='thought'>[General] Your mind hears Someone thinking, </preset>\"Yup, it works!\"\n",
293+
"<popStream/><prompt time=\"1766284988\">&gt;</prompt>"
294+
])
295+
XCTAssertEqual(commands.count, 4)
296+
297+
switch commands[3] {
298+
case let .text(tags):
299+
XCTAssertEqual(tags.count, 2)
300+
XCTAssertEqual(tags[0].text, "[General] Your mind hears Someone thinking, \"Yup, it works!\"\n")
301+
default:
302+
XCTFail()
303+
}
304+
}
305+
306+
func test_combines_personal_recieve_concise_thoughts_stream() {
307+
let commands = streamCommands([
308+
"<pushStream id=\"thoughts\"/><preset id='thought'>[Personal][Someone] </preset>\"&lt;to you&gt;\" \"test thought\"\n",
309+
"<popStream/><prompt time=\"1766284988\">&gt;</prompt>"
310+
])
311+
XCTAssertEqual(commands.count, 4)
312+
313+
switch commands[3] {
314+
case let .text(tags):
315+
XCTAssertEqual(tags.count, 2)
316+
XCTAssertEqual(tags[0].text, "[Personal][Someone] \"<to you>\" \"test thought\"\n")
317+
default:
318+
XCTFail()
319+
}
320+
}
321+
322+
func test_combines_personal_recieve_thoughts_stream() {
323+
let commands = streamCommands([
324+
"<pushStream id=\"thoughts\"/><preset id='thought'>[Personal] Your mind hears Someone thinking, </preset>\"&lt;to you&gt;\" \"test thought\"\n",
325+
"<popStream/><prompt time=\"1766284988\">&gt;</prompt>"
326+
])
327+
XCTAssertEqual(commands.count, 4)
328+
329+
switch commands[3] {
330+
case let .text(tags):
331+
XCTAssertEqual(tags.count, 2)
332+
XCTAssertEqual(tags[0].text, "[Personal] Your mind hears Someone thinking, \"<to you>\" \"test thought\"\n")
333+
default:
334+
XCTFail()
335+
}
336+
}
337+
338+
func test_combines_send_thoughts_stream() {
339+
let commands = streamCommands([
340+
"<pushStream id=\"thoughts\"/><preset id='thought'>You to Saracus,</preset> \"Yup, it works!\"\n",
341+
"<popStream/>You project your thoughts to Saracus.",
342+
"<prompt time=\"1766284988\">&gt;</prompt>"
343+
])
344+
XCTAssertEqual(commands.count, 5)
345+
346+
switch commands[4] {
347+
case let .text(tags):
348+
XCTAssertEqual(tags.count, 3)
349+
XCTAssertEqual(tags[0].text, "You to Saracus, \"Yup, it works!\"\n")
350+
default:
351+
XCTFail()
352+
}
353+
}
289354

290355
// func test_urchin_stream() {
291356
// let commands = streamCommands([

0 commit comments

Comments
 (0)