Skip to content

Commit

Permalink
DSL: add test for #INCLUDE, #503
Browse files Browse the repository at this point in the history
  • Loading branch information
ilius committed Sep 19, 2024
1 parent f269bd5 commit d94ed77
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/g_dsl_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ def __init__(self, *args, **kwargs):
"dsl/002-m-tag_multiline-paragraph-v2.txt": "d5001afd",
"dsl/003-ref-target-c.dsl": "9c1396c4",
"dsl/003-ref-target-c.txt": "ab41cedf",
"dsl/006-include/included.dsl": "10ef1018",
"dsl/006-include/main.dsl": "8325d538",
"dsl/006-include/main.txt": "d7ed9f2b",
},
)

Expand Down Expand Up @@ -74,6 +77,31 @@ def convert_dsl_txt(self, fname, fname2, **convertArgs):
**convertArgs,
)

def test_include(self):
dirName = "dsl/006-include"
fname = "main"
files = ["included.dsl", "main.dsl"]

inputDirPath = self.downloadDir(dirName, files)
inputFilePath = join(inputDirPath, f"{fname}.dsl")
outputFilePath = self.newTempFilePath(f"{fname}-2.txt")
expectedOutputFilePath = self.downloadFile(join(dirName, f"{fname}.txt"))
self.glos = Glossary()
result = self.glos.convert(
ConvertArgs(
inputFilename=inputFilePath,
outputFilename=outputFilePath,
)
)
self.assertIsNotNone(result)
self.assertEqual(result, outputFilePath)

self.compareTextFiles(
outputFilePath,
expectedOutputFilePath,
)


def test_russianAmericanEnglish(self):
self.convert_dsl_txt(
"100-RussianAmericanEnglish-ru-en",
Expand Down

0 comments on commit d94ed77

Please sign in to comment.