From 09939a07396ee50073c49f6fdd754761f12345fd Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Fri, 26 Jun 2026 11:06:30 +1000 Subject: [PATCH] Add `values-car` pruning regression test Android's `car` qualifier represents UI mode, not a locale, so the pruning action should leave `values-car` resources untouched. This is intentionally test-only coverage; the production fix is not included. --- Generated with the help of Codex, https://openai.com/codex Co-Authored-By: Codex GPT-5 --- ...ndroid_prune_orphaned_translations_spec.rb | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/spec/android_prune_orphaned_translations_spec.rb b/spec/android_prune_orphaned_translations_spec.rb index e51de2b21..3ae43e5b2 100644 --- a/spec/android_prune_orphaned_translations_spec.rb +++ b/spec/android_prune_orphaned_translations_spec.rb @@ -89,6 +89,26 @@ def write_file(path, content) end end + it 'leaves car UI mode qualifier directories untouched' do + Dir.mktmpdir do |dir| + res_dir = File.join(dir, 'res') + write_file(File.join(res_dir, 'values', 'strings.xml'), default_strings) + car_file = File.join(res_dir, 'values-car', 'strings.xml') + car_content = <<~XML + + + Car + + XML + write_file(car_file, car_content) + + pruned = run_described_fastlane_action(res_dir: res_dir) + + expect(pruned).to eq(0) + expect(File.read(car_file)).to eq(car_content) + end + end + it 'treats keys from `additional_source_strings_paths` as valid (flavor overlay case)' do Dir.mktmpdir do |dir| res_dir = File.join(dir, 'res')