v1.4.2
source_gen_test
source_gen 套件的測試支援。包含協助程式,可輕鬆驗證成功與失敗案例。
13喜歡 4.9萬近 30 天下載160Pub 分數
macOSWindowsLinux
測試 API,以便更容易為 package:source_gen 產生器建立穩健的測試
以下為英文專案原文快照,最新內容請造訪 GitHub。
Make it easy to test Generators derived from package:source_gen by
annotating test files.
@ShouldGenerate(
r'''
const TestClass1NameLength = 10;
const TestClass1NameLowerCase = 'testclass1';
''',
configurations: ['default', 'no-prefix-required'],
)
@ShouldThrow(
'Uh...',
configurations: ['vague'],
element: false,
)
@TestAnnotation()
class TestClass1 {}
Test against a golden output file if you also want to write tests on the output itself.
part 'goldens/testclass2.dart';
@ShouldGenerateFile(
'goldens/testclass2.dart',
partOfCurrent: true,
configurations: ['default', 'no-prefix-required'],
)
@ShouldThrow(
'Uh...',
configurations: ['vague'],
element: false,
)
@TestAnnotation()
class TestClass2 {}
Other helpers are also provided.
依賴清單 11 項
>=9.0.0 <15.0.0^4.0.3^3.5.4^3.1.3^1.16.0^1.9.0^4.1.1^1.27.0^0.3.1^1.19.0^3.0.0先依使用情境篩選,再比較專案活躍情況,最後到原始儲存庫確認使用要求。
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗