Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add functional test
Browse files Browse the repository at this point in the history
zenlyj committed Jan 4, 2025
1 parent 4e9c09b commit 36d2824
Showing 3 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions tests/functional/r/redefined/redefined_builtin_allowed.py
Original file line number Diff line number Diff line change
@@ -7,3 +7,8 @@ def function():
print(dir, dict)

list = "not in globals" # [redefined-builtin]

def global_variable_redefine():
"""Shadow `len` using the `global` keyword."""
global len
len = 1 # [redefined-builtin]
4 changes: 2 additions & 2 deletions tests/functional/r/redefined/redefined_builtin_allowed.rc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[messages control]
disable = invalid-name
disable = invalid-name, global-variable-undefined
[variables]
allowed-redefined-builtins = dir, list
allowed-redefined-builtins = dir, list, len
1 change: 1 addition & 0 deletions tests/functional/r/redefined/redefined_builtin_allowed.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
redefined-builtin:6:4:6:8:function:Redefining built-in 'dict':UNDEFINED
redefined-builtin:9:0:9:4::Redefining built-in 'list':UNDEFINED
redefined-builtin:14:4:14:7:global_variable_redefine:Redefining built-in 'len':UNDEFINED

0 comments on commit 36d2824

Please sign in to comment.