Documentation

FT133 (micro failure)

Back to documentation index
{
  "@context": "https://nxdlang.org/schema",
  "doc_id": "PT133",
  "title": "PT133 - Intentional Failures",
  "description": "Intentional Test Failures",
  "layer": "Passed Tests",
  "category": "Passed Tests - Nim",
  "keywords": [Nim, Pass, Test],
  "doc_version": "1.0",
  "status": "active"
}

# FT133 (micro failure)

### NXD Sample:

```nxd
MODULE TEST

TYPE PERSON STRUCT:
    NAME: string,
    AGE: int

FUNC MAIN()
    PRINTLN("STRUCT_DECLARED")
```

### Result:

PASS

### Expected Output:

FAIL - 

### Expected Rejection Stage:

[ ] Lexer
[ ] Parser
[ ] AST
[ ] IR
[ ] Semantics
[ ] Backend

### Actual Output:

```json
{
  "module": {
    "name": "TEST",
    "imports": []
  },
  "types": [
    {
      "kind": "struct",
      "name": "PERSON",
      "fields": [
        {
          "name": "NAME",
          "ty": "string"
        },
        {
          "name": "AGE",
          "ty": "int"
        }
      ]
    }
  ],
  "traits": [],
  "impls": [],
  "functions": [
    {
      "name": "MAIN",
      "params": [],
      "return_type": null,
      "body": [
        {
          "Expr": {
            "Call": {
              "func": "PRINTLN",
              "args": [
                {
                  "Literal": {
                    "String": "STRUCT_DECLARED"
                  }
                }
              ]
            }
          }
        }
      ]
    }
  ],
  "statements": []
}
```

```nim
# test


type
  PERSON = object
    name: string
    age: int

proc main() =
  println("STRUCT_DECLARED")

```

### Notes: