From 69e3149ded12485bb51c7f5472096bd0688d194d Mon Sep 17 00:00:00 2001 From: Phodal Huang Date: Sat, 6 Jan 2024 16:11:32 +0800 Subject: [PATCH] refactor(c): update for testing --- README.md | 10 ++++------ .../chapi/ast/cast/CFullIdentListenerTest.kt | 16 +++++++++------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 9b57c323..471cd6be 100644 --- a/README.md +++ b/README.md @@ -21,14 +21,14 @@ language stages: | Features | Java | Python | Go | Kotlin | TS/JS | C | C# | Scala | C++ | Rust | |---------------|------|--------|----|--------|-------|----|----|-------|-----|------| | http api decl | βœ… | πŸ†• | πŸ†• | βœ… | βœ… | πŸ†• | πŸ†• | | | πŸ†• | -| syntax parse | βœ… | βœ… | βœ… | βœ… | βœ… | πŸ†• | πŸ†• | βœ… | πŸ†• | βœ… | +| syntax parse | βœ… | βœ… | βœ… | βœ… | βœ… | βœ… | πŸ†• | βœ… | πŸ†• | βœ… | | function call | βœ… | πŸ†• | πŸ†• | βœ… | βœ… | | | | | βœ… | | arch/package | βœ… | | | βœ… | βœ… | | | βœ… | | πŸ†• | | real world | βœ… | | | πŸ†• | βœ… | | | | | | -- [ArchGuard](https://github.com/archguard/archguard) - ArchGuard is a architecture workbench, also for architecture - governance, which can analysis architecture in container, component, code level, create architecure fitness functions, - and anaysis system dependencies.. +- [ArchGuard](https://github.com/archguard/archguard) - ArchGuard is an architecture workbench, also for architecture + governance, which can analysis architecture in container, component, code level, create architecture fitness functions, + and analysis system dependencies. - [UnitGen](https://github.com/unit-mesh/unit-gen) is a code fine-tuning data framework that generates data from your existing codebase. - [ChocolateFactory](https://github.com/unit-mesh/chocolate-factory) is a cutting-edge LLM toolkit designed to empower @@ -38,7 +38,6 @@ PS: welcome to PR to send your projects ## Language Information - language versions(testedοΌ‰: - Java: 8, 11, 17 @@ -47,7 +46,6 @@ language versions(testedοΌ‰: - Rust: v1.60.0 - Python: 2, 3 - // tier 1 languages ":chapi-ast-java", ":chapi-ast-typescript", diff --git a/chapi-ast-c/src/test/kotlin/chapi/ast/cast/CFullIdentListenerTest.kt b/chapi-ast-c/src/test/kotlin/chapi/ast/cast/CFullIdentListenerTest.kt index d5d680d4..7dab02be 100644 --- a/chapi-ast-c/src/test/kotlin/chapi/ast/cast/CFullIdentListenerTest.kt +++ b/chapi-ast-c/src/test/kotlin/chapi/ast/cast/CFullIdentListenerTest.kt @@ -1,17 +1,19 @@ package chapi.ast.cast import org.junit.jupiter.api.Test +import java.io.File import kotlin.test.assertEquals internal class CFullIdentListenerTest { - @Test - internal fun shouldGetCodeFileName() { - val code = this::class.java.getResource("/_fixtures/examples/1-helloworld.c").readText() - val fileName = "helloworld.c" - - val codeFile = CAnalyser().analysis(code, fileName) - assertEquals(codeFile.FullName, fileName) + @Test + fun allGrammarUnderResources() { + val content = this::class.java.getResource("/grammar")!! + File(content.toURI()).walkTopDown().forEach { + if (it.isFile && it.extension == "rs") { + CAnalyser().analysis(it.readText(), it.name) + } + } } @Test