MCPcopy Create free account
hub / github.com/auth0/auth0-cli / TestExtractPbxprojBundleID

Function TestExtractPbxprojBundleID

internal/cli/quickstart_detect_test.go:2714–2774  ·  view source on GitHub ↗

-- extractPbxprojBundleID --.

(t *testing.T)

Source from the content-addressed store, hash-verified

2712// -- extractPbxprojBundleID --.
2713
2714func TestExtractPbxprojBundleID(t *testing.T) {
2715 tests := []struct {
2716 name string
2717 content string
2718 want string
2719 }{
2720 {
2721 name: "single app target returns it",
2722 content: `PRODUCT_BUNDLE_IDENTIFIER = com.example.app;`,
2723 want: "com.example.app",
2724 },
2725 {
2726 name: "test target appears first - skipped, app target returned",
2727 content: `PRODUCT_BUNDLE_IDENTIFIER = com.example.app.RunnerTests;
2728PRODUCT_BUNDLE_IDENTIFIER = com.example.app;`,
2729 want: "com.example.app",
2730 },
2731 {
2732 name: ".Tests suffix skipped",
2733 content: `PRODUCT_BUNDLE_IDENTIFIER = com.example.app.Tests;
2734PRODUCT_BUNDLE_IDENTIFIER = com.example.app;`,
2735 want: "com.example.app",
2736 },
2737 {
2738 name: ".UITests suffix skipped",
2739 content: `PRODUCT_BUNDLE_IDENTIFIER = com.example.app.UITests;
2740PRODUCT_BUNDLE_IDENTIFIER = com.example.app;`,
2741 want: "com.example.app",
2742 },
2743 {
2744 name: "no match returns empty",
2745 content: `OTHER_KEY = some.value;`,
2746 want: "",
2747 },
2748 {
2749 name: "all test targets - returns empty",
2750 content: `PRODUCT_BUNDLE_IDENTIFIER = com.example.app.RunnerTests;
2751PRODUCT_BUNDLE_IDENTIFIER = com.example.app.UITests;`,
2752 want: "",
2753 },
2754 {
2755 // Com.example.appTests (no dot) previously passed the filter.
2756 name: "no-dot Tests suffix skipped",
2757 content: `PRODUCT_BUNDLE_IDENTIFIER = com.example.appTests;
2758PRODUCT_BUNDLE_IDENTIFIER = com.example.app;`,
2759 want: "com.example.app",
2760 },
2761 {
2762 name: "no-dot UITests suffix skipped",
2763 content: `PRODUCT_BUNDLE_IDENTIFIER = com.example.appUITests;
2764PRODUCT_BUNDLE_IDENTIFIER = com.example.app;`,
2765 want: "com.example.app",
2766 },
2767 }
2768 for _, tc := range tests {
2769 tc := tc
2770 t.Run(tc.name, func(t *testing.T) {
2771 assert.Equal(t, tc.want, extractPbxprojBundleID(tc.content))

Callers

nothing calls this directly

Calls 1

extractPbxprojBundleIDFunction · 0.85

Tested by

no test coverage detected