mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2025-12-15 11:42:26 +08:00
14 lines
518 B
Ruby
14 lines
518 B
Ruby
# =========================================================================
|
|
# Unity - A Test Framework for C
|
|
# ThrowTheSwitch.org
|
|
# Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams
|
|
# SPDX-License-Identifier: MIT
|
|
# =========================================================================
|
|
|
|
module TypeSanitizer
|
|
def self.sanitize_c_identifier(unsanitized)
|
|
# convert filename to valid C identifier by replacing invalid chars with '_'
|
|
unsanitized.gsub(/[-\/\\.,\s]/, '_')
|
|
end
|
|
end
|