From a49303c93fd07d02e186f0b3aa4b2d4777d8b485 Mon Sep 17 00:00:00 2001 From: Arfon Smith Date: Mon, 16 Dec 2013 15:27:48 -0800 Subject: [PATCH] Expanding TestHeuristcs to include all Objective C header files --- lib/linguist/samples.json | 609 ++++++++++++++++++++++++++++---------- test/test_heuristics.rb | 13 +- 2 files changed, 469 insertions(+), 153 deletions(-) diff --git a/lib/linguist/samples.json b/lib/linguist/samples.json index 143e0fc4..aedb3d84 100644 --- a/lib/linguist/samples.json +++ b/lib/linguist/samples.json @@ -509,8 +509,8 @@ ".gemrc" ] }, - "tokens_total": 426869, - "languages_total": 499, + "tokens_total": 428226, + "languages_total": 503, "tokens": { "ABAP": { "*/**": 1, @@ -8558,48 +8558,177 @@ "yajl_free_error": 1 }, "C++": { - "class": 34, + "class": 40, "Bar": 2, - "{": 550, + "{": 562, "protected": 4, - "char": 122, + "char": 126, "*name": 6, - ";": 2290, - "public": 27, - "void": 150, + ";": 2383, + "public": 33, + "void": 169, "hello": 2, - "(": 2422, - ")": 2424, - "}": 549, - "#include": 106, + "(": 2498, + ")": 2500, + "}": 562, + "#pragma": 2, + "once": 2, + "#include": 117, + "": 4, + "": 4, + "": 2, + "using": 4, + "namespace": 30, + "std": 52, + "#define": 197, + "DEFAULT_DELIMITER": 1, + "CsvStreamer": 5, + "private": 16, + "ofstream": 1, + "file": 28, + "//": 268, + "File": 1, + "output": 11, + "stream": 6, + "vector": 16, + "row_buffer": 1, + "Buffer": 3, + "which": 6, + "stores": 3, + "a": 105, + "row": 12, + "s": 11, + "data": 8, + "before": 3, + "being": 3, + "flushed/written": 1, + "int": 157, + "fields": 4, + "Number": 2, + "of": 73, + "columns": 2, + "long": 10, + "rows": 3, + "records": 2, + "including": 2, + "header": 4, + "delimiter": 2, + "Delimiter": 1, + "character": 10, + "comma": 2, + "by": 7, + "default": 7, + "string": 24, + "sanitize": 1, + "Returns": 1, + "ready": 1, + "for": 27, + "into": 2, + "the": 238, + "Empty": 1, + "CSV": 4, + "streamer...": 1, + "be": 12, + "sure": 2, + "to": 88, + "open": 5, + "writing": 1, + "Same": 1, + "as": 5, + "...": 1, + "Opens": 3, + "an": 8, + "given": 4, + "path/name": 3, + "Ensures": 1, + "is": 40, + "closed": 1, + "and": 20, + "saved": 1, + "delimiting": 1, + "add_field": 1, + "If": 5, + "still": 1, + "on": 3, + "first": 9, + "line": 11, + "adds": 1, + "new": 11, + "field": 5, + "save_fields": 1, + "Call": 1, + "this": 35, + "save": 1, + "all": 2, + "writes": 2, + "should": 3, + "through": 3, + "append": 8, + "Appends": 5, + "current": 15, + "with": 12, + "next": 7, + "quoted": 1, + "only": 3, + "if": 298, + "needed": 2, + "leading/trailing": 1, + "spaces": 3, + "are": 4, + "trimmed": 1, + "bool": 104, + "Like": 1, + "but": 3, + "can": 5, + "specify": 1, + "whether": 2, + "trim": 2, + "at": 8, + "either": 2, + "end": 20, + "false": 44, + "keep": 1, + "float": 8, + "number": 11, + "double": 25, + "writeln": 1, + "Flushes": 1, + "what": 1, + "was": 5, + "in": 19, + "buffer": 2, + "close": 2, + "Saves": 1, + "closes": 1, + "field_count": 1, + "Gets": 2, + "row_count": 1, + "-": 236, + "NOT": 2, "": 1, "": 1, "": 2, - "static": 260, + "static": 262, "Env": 13, "*env_instance": 1, - "*": 159, - "NULL": 108, + "*": 160, + "NULL": 109, "*Env": 1, "instance": 4, - "if": 295, "env_instance": 3, - "new": 9, - "return": 147, + "return": 148, "QObject": 2, "QCoreApplication": 1, "parse": 3, - "const": 166, + "const": 169, "**envp": 1, "**env": 1, "**": 2, "QString": 20, "envvar": 2, - "name": 21, + "name": 25, "value": 18, - "int": 144, "indexOfEquals": 5, - "for": 18, "env": 3, "envp": 4, "*env": 1, @@ -8612,19 +8741,23 @@ "QVariantMap": 3, "asVariantMap": 2, "m_map": 2, - "#ifndef": 23, + "#ifndef": 25, "ENV_H": 3, - "#define": 190, "": 1, "Q_OBJECT": 1, "*instance": 1, - "private": 12, - "#endif": 82, - "//": 238, + "#endif": 85, + "enum": 7, + "Field": 2, + "Free": 1, + "Black": 1, + "White": 1, + "Illegal": 1, + "typedef": 39, + "Player": 1, "GDSDBREADER_H": 3, "": 1, "GDS_DIR": 1, - "enum": 6, "level": 1, "LEVEL_ONE": 1, "LEVEL_TWO": 1, @@ -8635,14 +8768,11 @@ "depth": 1, "userIndex": 1, "QByteArray": 1, - "data": 2, "This": 6, - "is": 35, "COMPRESSED": 1, "optimize": 1, "ram": 1, - "and": 14, - "disk": 1, + "disk": 2, "space": 2, "decompressed": 1, "quint64": 1, @@ -8655,28 +8785,20 @@ "dbDataStructure*": 1, "father": 1, "fatherIndex": 1, - "bool": 99, "noFatherRoot": 1, - "Used": 1, - "to": 75, + "Used": 2, "tell": 1, - "this": 22, "node": 1, - "the": 178, "root": 1, "so": 1, "hasn": 1, - "t": 13, - "in": 9, + "t": 14, "argument": 1, - "list": 2, - "of": 48, - "an": 3, + "list": 3, "operator": 10, "overload.": 1, - "A": 1, + "A": 4, "friend": 10, - "stream": 5, "<<": 18, "myclass.label": 2, "myclass.depth": 2, @@ -8691,19 +8813,15 @@ "myclass.firstLineData": 4, "myclass.linesNumbers": 2, "QDataStream": 2, - "&": 146, + "&": 147, "myclass": 1, "//Don": 1, "read": 1, - "it": 2, - "either": 1, + "it": 7, "qUncompress": 2, - "": 1, - "using": 1, - "namespace": 26, - "std": 49, + "": 2, "main": 2, - "cout": 1, + "cout": 2, "endl": 1, "": 1, "": 1, @@ -8738,7 +8856,7 @@ "ECDSA_SIG_recover_key_GFp": 3, "ECDSA_SIG": 3, "*ecsig": 1, - "unsigned": 20, + "unsigned": 21, "*msg": 2, "msglen": 2, "recid": 3, @@ -8758,7 +8876,6 @@ "n": 28, "i": 47, "/": 13, - "-": 225, "BN_CTX_start": 1, "order": 8, "BN_CTX_get": 8, @@ -8769,7 +8886,6 @@ "BN_add": 1, "ecsig": 3, "r": 36, - "field": 3, "EC_GROUP_get_curve_GFp": 1, "BN_cmp": 1, "R": 6, @@ -8779,19 +8895,18 @@ "EC_POINT_is_at_infinity": 1, "Q": 5, "EC_GROUP_get_degree": 1, - "e": 14, + "e": 15, "BN_bin2bn": 3, "msg": 1, "*msglen": 1, "BN_rshift": 1, - "zero": 3, + "zero": 5, "BN_zero": 1, "BN_mod_sub": 1, "rr": 4, "BN_mod_inverse": 1, "sor": 3, "BN_mod_mul": 2, - "s": 9, "eor": 3, "BN_CTX_end": 1, "CKey": 26, @@ -8800,9 +8915,8 @@ "pkey": 14, "POINT_CONVERSION_COMPRESSED": 1, "fCompressedPubKey": 5, - "true": 39, + "true": 40, "Reset": 5, - "false": 42, "EC_KEY_new_by_curve_name": 2, "NID_secp256k1": 2, "throw": 4, @@ -8824,15 +8938,14 @@ "Shrink": 1, "fit": 1, "actual": 1, - "size": 9, + "size": 12, "SignCompact": 2, "uint256": 10, - "vector": 14, "": 19, "fOk": 3, "*sig": 2, "ECDSA_do_sign": 1, - "char*": 14, + "char*": 17, "sig": 11, "nBitsR": 3, "BN_num_bits": 2, @@ -8870,12 +8983,10 @@ "key2.GetPubKey": 1, "BITCOIN_KEY_H": 2, "": 1, - "": 2, "": 1, - "definition": 1, + "definition": 2, "runtime_error": 2, - "explicit": 3, - "string": 10, + "explicit": 4, "str": 2, "CKeyID": 5, "uint160": 8, @@ -8883,7 +8994,6 @@ "CPubKey": 11, "vchPubKey": 6, "vchPubKeyIn": 2, - "a": 84, "a.vchPubKey": 3, "b.vchPubKey": 3, "IMPLEMENT_SERIALIZE": 1, @@ -8898,7 +9008,6 @@ "||": 17, "IsCompressed": 2, "Raw": 1, - "typedef": 38, "secure_allocator": 2, "CPrivKey": 3, "EC_KEY*": 1, @@ -8912,7 +9021,181 @@ "GetPrivKey": 1, "SetPubKey": 1, "Sign": 1, - "#ifdef": 16, + "LIBCANIH": 2, + "": 1, + "": 1, + "int64": 1, + "//#define": 1, + "DEBUG": 5, + "#ifdef": 17, + "dout": 2, + "#else": 25, + "cerr": 1, + "libcanister": 2, + "//the": 8, + "canmem": 22, + "object": 3, + "generic": 1, + "memory": 5, + "container": 2, + "used": 7, + "commonly": 1, + "//throughout": 1, + "canister": 14, + "framework": 1, + "hold": 1, + "uncertain": 1, + "//length": 1, + "may": 4, + "or": 13, + "not": 6, + "contain": 1, + "null": 3, + "bytes.": 1, + "raw": 2, + "block": 2, + "absolute": 1, + "length": 10, + "//creates": 3, + "unallocated": 1, + "allocsize": 1, + "allocated": 1, + "blank": 1, + "strdata": 1, + "//automates": 1, + "creation": 1, + "limited": 2, + "canmems": 1, + "//cleans": 1, + "up": 15, + "zeromem": 1, + "//overwrites": 2, + "fragmem": 1, + "fragment": 1, + "notation": 1, + "countlen": 1, + "//counts": 1, + "strings": 1, + "//removes": 1, + "any": 8, + "nulls": 1, + "from": 28, + "//returns": 2, + "singleton": 2, + "//contains": 2, + "information": 1, + "about": 2, + "caninfo": 2, + "path": 8, + "//physical": 1, + "internalname": 1, + "//a": 1, + "numfiles": 1, + "files": 6, + "//necessary": 1, + "use": 3, + "type": 7, + "canfile": 7, + "//this": 1, + "holds": 2, + "within": 2, + "//canister": 1, + "canister*": 1, + "parent": 1, + "that": 11, + "//internal": 1, + "id": 1, + "//use": 1, + "their": 1, + "own.": 1, + "newline": 2, + "delimited": 2, + "container.": 1, + "TOC": 1, + "info": 2, + "general": 1, + "canfiles": 1, + "recommended": 1, + "programs": 1, + "do": 7, + "modify": 1, + "//these": 1, + "directly": 1, + "enforced.": 1, + "canfile*": 1, + "readonly": 3, + "//if": 1, + "then": 7, + "no": 2, + "write": 1, + "routines": 1, + "will": 3, + "anything": 1, + "//maximum": 1, + "have": 3, + "//time": 1, + "change": 2, + "whatever": 1, + "suits": 1, + "your": 4, + "application.": 1, + "cachemax": 2, + "cachecnt": 1, + "//number": 1, + "cache": 2, + "modified": 3, + "//both": 1, + "initialize": 1, + "physical": 1, + "location": 5, + "fspath": 3, + "//destroys": 1, + "after": 2, + "flushing": 1, + "modded": 1, + "buffers": 2, + "course": 1, + "//open": 1, + "//does": 1, + "exist": 2, + "//close": 1, + "flush": 1, + "clean": 2, + "//deletes": 1, + "inside": 1, + "delFile": 1, + "//pulls": 1, + "contents": 2, + "returns": 2, + "getFile": 1, + "does": 1, + "otherwise": 1, + "overwrites": 1, + "operation": 1, + "succeeded": 2, + "writeFile": 2, + "//get": 1, + "containing": 1, + "//list": 1, + "paths": 1, + "getTOC": 1, + "//brings": 1, + "back": 1, + "limit": 1, + "//important": 1, + "sCFID": 2, + "safe": 1, + "CFID": 2, + "we": 3, + "want": 3, + "avoid": 1, + "uncaching": 1, + "//really": 1, + "just": 1, + "internally": 1, + "harm.": 1, + "cacheclean": 1, + "dFlush": 1, "Q_OS_LINUX": 2, "": 1, "#if": 44, @@ -8921,10 +9204,9 @@ "#error": 9, "Something": 1, "wrong": 1, - "with": 6, "setup.": 1, "Please": 3, - "report": 2, + "report": 3, "mailing": 1, "argc": 2, "char**": 2, @@ -8954,6 +9236,108 @@ "phantom.execute": 1, "app.exec": 1, "phantom.returnValue": 1, + "NINJA_METRICS_H_": 3, + "For": 1, + "int64_t.": 1, + "///": 17, + "The": 11, + "Metrics": 2, + "module": 1, + "debug": 1, + "mode": 5, + "dumps": 1, + "timing": 2, + "stats": 2, + "various": 1, + "actions.": 1, + "To": 1, + "see": 1, + "METRIC_RECORD": 4, + "below.": 1, + "single": 1, + "metrics": 2, + "ve": 2, + "hit": 1, + "code": 2, + "path.": 2, + "count": 1, + "Total": 1, + "time": 3, + "micros": 1, + "spent": 1, + "int64_t": 3, + "sum": 1, + "scoped": 1, + "recording": 1, + "metric": 2, + "across": 1, + "body": 1, + "function.": 2, + "macro.": 1, + "struct": 11, + "ScopedMetric": 4, + "Metric*": 4, + "metric_": 1, + "Timestamp": 1, + "when": 6, + "measurement": 1, + "started.": 1, + "Value": 24, + "platform": 2, + "dependent.": 1, + "start_": 1, + "prints": 1, + "report.": 1, + "NewMetric": 2, + "Print": 2, + "summary": 1, + "stdout.": 1, + "Report": 1, + "": 1, + "metrics_": 1, + "Get": 1, + "relative": 2, + "some": 1, + "epoch.": 1, + "Epoch": 1, + "varies": 1, + "between": 1, + "platforms": 1, + "useful": 1, + "measuring": 1, + "elapsed": 1, + "time.": 1, + "GetTimeMillis": 1, + "simple": 1, + "stopwatch": 1, + "seconds": 1, + "since": 2, + "Restart": 3, + "called.": 1, + "Stopwatch": 2, + "started_": 4, + "Seconds": 1, + "call.": 1, + "Elapsed": 1, + "static_cast": 8, + "": 1, + "Now": 3, + "uint64_t": 4, + "primary": 1, + "interface": 1, + "metrics.": 1, + "Use": 2, + "top": 1, + "function": 1, + "get": 1, + "recorded": 1, + "each": 3, + "call": 1, + "metrics_h_metric": 2, + "g_metrics": 3, + "metrics_h_scoped": 1, + "extern": 5, + "Metrics*": 1, "INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION": 1, "": 1, "": 2, @@ -8975,7 +9359,6 @@ "protobuf_AssignDesc_protocol_2dbuffer_2eproto": 4, "protobuf_AddDesc_protocol_2dbuffer_2eproto": 6, "FileDescriptor*": 1, - "file": 6, "DescriptorPool": 3, "generated_pool": 2, "FindFileByName": 1, @@ -9007,14 +9390,12 @@ "InternalRegisterGeneratedFile": 1, "InitAsDefaultInstance": 3, "OnShutdown": 1, - "struct": 8, "StaticDescriptorInitializer_protocol_2dbuffer_2eproto": 2, "static_descriptor_initializer_protocol_2dbuffer_2eproto_": 1, "_MSC_VER": 3, "kNameFieldNumber": 2, "Message": 7, "SharedCtor": 4, - "from": 25, "MergeFrom": 9, "_cached_size_": 7, "const_cast": 3, @@ -9060,13 +9441,11 @@ "else": 46, "handle_uninterpreted": 2, "ExpectAtEnd": 1, - "default": 4, "WIRETYPE_END_GROUP": 1, "SkipField": 1, "#undef": 3, "SerializeWithCachedSizes": 2, "CodedOutputStream*": 2, - "output": 5, "SERIALIZE": 2, "WriteString": 1, "unknown_fields": 7, @@ -9104,19 +9483,13 @@ "metadata.descriptor": 1, "metadata.reflection": 1, "PROTOBUF_protocol_2dbuffer_2eproto__INCLUDED": 3, - "": 1, "GOOGLE_PROTOBUF_VERSION": 1, - "was": 3, "generated": 2, - "by": 5, "newer": 2, "version": 4, "protoc": 2, - "which": 2, "incompatible": 2, - "your": 3, "Protocol": 2, - "Buffer": 2, "headers.": 3, "update": 1, "GOOGLE_PROTOBUF_MIN_PROTOC_VERSION": 1, @@ -9149,30 +9522,22 @@ "SWIG": 2, "QSCICOMMAND_H": 2, "__APPLE__": 4, - "extern": 4, "": 1, "": 2, "": 1, "QsciScintilla": 7, "brief": 2, - "The": 8, "QsciCommand": 7, "represents": 1, "editor": 1, "command": 9, - "that": 7, - "may": 2, - "have": 1, "one": 42, - "or": 10, "two": 1, "keys": 3, "bound": 4, "it.": 2, "Methods": 1, - "are": 3, "provided": 1, - "change": 1, "remove": 1, "binding.": 1, "Each": 1, @@ -9180,15 +9545,12 @@ "user": 2, "friendly": 2, "description": 3, - "use": 1, "mapping": 1, "dialogs.": 1, "QSCINTILLA_EXPORT": 2, "defines": 1, "different": 1, "commands": 1, - "can": 3, - "be": 9, "assigned": 1, "key.": 1, "Command": 4, @@ -9209,7 +9571,6 @@ "view": 2, "LineScrollDown": 1, "SCI_LINESCROLLDOWN": 1, - "up": 13, "LineUp": 1, "SCI_LINEUP": 1, "LineUpExtend": 1, @@ -9222,12 +9583,10 @@ "document.": 8, "ScrollToStart": 1, "SCI_SCROLLTOSTART": 1, - "end": 18, "ScrollToEnd": 1, "SCI_SCROLLTOEND": 1, "vertically": 1, "centre": 1, - "current": 9, "VerticalCentreCaret": 1, "SCI_VERTICALCENTRECARET": 1, "paragraph.": 4, @@ -9268,7 +9627,6 @@ "SCI_WORDLEFTEND": 1, "WordLeftEndExtend": 1, "SCI_WORDLEFTENDEXTEND": 1, - "next": 6, "WordRightEnd": 1, "SCI_WORDRIGHTEND": 1, "WordRightEndExtend": 1, @@ -9299,9 +9657,7 @@ "SCI_HOMEWRAP": 1, "HomeWrapExtend": 1, "SCI_HOMEWRAPEXTEND": 1, - "first": 8, "visible": 6, - "character": 8, "VCHome": 1, "SCI_VCHOME": 1, "VCHomeExtend": 1, @@ -9362,8 +9718,6 @@ "SCI_CLEAR": 1, "DeleteBack": 1, "SCI_DELETEBACK": 1, - "not": 1, - "at": 4, "DeleteBackNotLine": 1, "SCI_DELETEBACKNOTLINE": 1, "left.": 2, @@ -9374,7 +9728,6 @@ "SCI_DELWORDRIGHT": 1, "DeleteWordRightEnd": 1, "SCI_DELWORDRIGHTEND": 1, - "line": 10, "DeleteLineLeft": 1, "SCI_DELLINELEFT": 1, "DeleteLineRight": 1, @@ -9427,7 +9780,6 @@ "EditToggleOvertype": 1, "SCI_EDITTOGGLEOVERTYPE": 1, "Insert": 2, - "platform": 1, "dependent": 1, "newline.": 1, "Newline": 1, @@ -9444,7 +9796,6 @@ "Backtab": 1, "SCI_BACKTAB": 1, "Cancel": 2, - "any": 5, "operation.": 1, "SCI_CANCEL": 1, "Undo": 2, @@ -9461,15 +9812,12 @@ "ZoomOut": 1, "SCI_ZOOMOUT": 1, "Return": 3, - "will": 2, "executed": 1, "instance.": 2, "scicmd": 2, "Execute": 1, "execute": 1, "Binds": 2, - "If": 4, - "then": 6, "binding": 3, "removed.": 2, "invalid": 5, @@ -9492,7 +9840,6 @@ "Key_Tab": 1, "Key_Return.": 1, "Keys": 1, - "modified": 2, "combination": 1, "SHIFT": 1, "CTRL": 1, @@ -9548,7 +9895,6 @@ "printer": 1, "paint": 1, "device": 1, - "mode": 4, "mode.": 1, "PrinterMode": 1, "ScreenResolution": 1, @@ -9556,50 +9902,38 @@ "Format": 1, "page": 4, "example": 1, - "before": 1, "drawn": 2, - "on": 1, "painter": 4, - "used": 4, "add": 3, "customised": 2, "graphics.": 2, "drawing": 4, "actually": 1, - "being": 2, "rather": 1, "than": 1, "sized.": 1, "methods": 1, "must": 1, - "only": 1, "called": 1, - "when": 5, "true.": 1, "area": 5, "draw": 1, "text.": 3, - "should": 1, "necessary": 1, "reserve": 1, "By": 1, - "relative": 1, "printable": 1, - "Use": 1, "setFullPage": 1, "because": 2, "calling": 1, "printRange": 2, "you": 1, - "want": 2, "try": 1, "over": 1, "pagenr": 2, - "number": 3, "numbered": 1, "formatPage": 1, "points": 2, - "each": 2, "font": 2, "printing.": 2, "setMagnification": 2, @@ -9608,14 +9942,12 @@ "Sets": 2, "printing": 2, "magnification.": 1, - "Print": 1, "range": 1, "qsb.": 1, "negative": 2, "signifies": 2, "returned": 2, "there": 1, - "no": 1, "error.": 1, "*qsb": 1, "wrap": 4, @@ -9672,12 +10004,10 @@ "LBRACE": 2, "RBRACE": 2, "BIT_NOT": 2, - "Value": 23, "Next": 3, "current_": 2, "next_": 2, "has_multiline_comment_before_next_": 5, - "static_cast": 7, "token": 64, "": 1, "pos": 12, @@ -9700,7 +10030,6 @@ "ScanHtmlComment": 3, "LT": 2, "next_.literal_chars": 13, - "do": 4, "ScanString": 3, "LTE": 1, "ASSIGN_SHL": 1, @@ -9716,7 +10045,6 @@ "ASSIGN": 1, "NE_STRICT": 1, "NE": 1, - "NOT": 1, "INC": 1, "ASSIGN_ADD": 1, "ADD": 1, @@ -9750,7 +10078,6 @@ "IsCarriageReturn": 2, "IsLineFeed": 2, "fall": 2, - "through": 2, "v": 3, "xx": 1, "xxx": 1, @@ -9850,7 +10177,6 @@ "utf16_literal": 3, "backing_store_.start": 5, "ascii_literal": 3, - "length": 8, "kInitialCapacity": 2, "kGrowthFactory": 2, "kMinConversionSlack": 1, @@ -9882,7 +10208,6 @@ "kNoOctalLocation": 1, "scanner_contants": 1, "current_token": 1, - "location": 4, "current_.location": 2, "literal_ascii_string": 1, "ASSERT_NOT_NULL": 9, @@ -9918,7 +10243,6 @@ "ScanRegExpFlags": 1, "IsIdentifier": 1, "CharacterStream*": 1, - "buffer": 1, "TokenDesc": 3, "LiteralBuffer*": 2, "literal_chars": 1, @@ -9934,7 +10258,6 @@ "LiteralScope*": 1, "ScanIdentifierUnicodeEscape": 1, "desc": 2, - "as": 1, "look": 1, "ahead": 1, "UTILS_H": 3, @@ -9944,12 +10267,10 @@ "QTemporaryFile": 1, "showUsage": 1, "QtMsgType": 1, - "type": 6, "dump_path": 1, "minidump_id": 1, "void*": 1, "context": 8, - "succeeded": 1, "QVariant": 1, "coffee2js": 1, "script": 1, @@ -9976,9 +10297,6 @@ "m_tempHarness": 1, "We": 1, "make": 1, - "sure": 1, - "clean": 1, - "after": 1, "ourselves": 1, "m_tempWrapper": 1, "V8_DECLARE_ONCE": 1, @@ -10067,9 +10385,7 @@ "IncrementCallDepth": 1, "DecrementCallDepth": 1, "union": 1, - "double": 23, "double_value": 1, - "uint64_t": 2, "uint64_t_value": 1, "double_int_union": 2, "Object*": 4, @@ -10105,7 +10421,6 @@ "V8_V8_H_": 3, "defined": 21, "GOOGLE3": 2, - "DEBUG": 3, "NDEBUG": 4, "both": 1, "set": 1, @@ -10124,7 +10439,6 @@ "PY_SSIZE_T_CLEAN": 1, "Py_PYTHON_H": 1, "Python": 1, - "needed": 1, "compile": 1, "C": 1, "extensions": 1, @@ -10132,7 +10446,6 @@ "install": 1, "development": 1, "Python.": 1, - "#else": 24, "": 1, "offsetof": 2, "member": 2, @@ -10191,7 +10504,6 @@ "*obj": 2, "len": 1, "itemsize": 2, - "readonly": 2, "ndim": 2, "*format": 1, "*shape": 1, @@ -10333,7 +10645,6 @@ "CYTHON_UNUSED": 7, "**p": 1, "*s": 1, - "long": 5, "encoding": 1, "is_unicode": 1, "is_str": 1, @@ -10410,7 +10721,6 @@ "npy_longdouble": 1, "__pyx_t_5numpy_longdouble_t": 1, "complex": 2, - "float": 7, "__pyx_t_float_complex": 27, "_Complex": 2, "real": 2, @@ -10823,7 +11133,6 @@ "PyTuple_GET_SIZE": 2, "PyTuple_GET_ITEM": 3, "PyObject_GetItem": 1, - "fields": 1, "PyTuple_CheckExact": 1, "tuple": 3, "__pyx_ptype_5numpy_dtype": 1, @@ -44791,7 +45100,7 @@ "Bluespec": 1298, "Brightscript": 579, "C": 58858, - "C++": 21308, + "C++": 22665, "Ceylon": 50, "Clojure": 510, "COBOL": 90, @@ -44926,7 +45235,7 @@ "Bluespec": 2, "Brightscript": 1, "C": 26, - "C++": 19, + "C++": 23, "Ceylon": 1, "Clojure": 7, "COBOL": 4, @@ -45047,5 +45356,5 @@ "Xtend": 2, "YAML": 1 }, - "md5": "8d40049b60f9c3a47eafac12ac2e9f8f" + "md5": "7e305e6e7267f7d227fa871bf83546b8" } \ No newline at end of file diff --git a/test/test_heuristics.rb b/test/test_heuristics.rb index 871e9878..e499cf7e 100644 --- a/test/test_heuristics.rb +++ b/test/test_heuristics.rb @@ -14,11 +14,18 @@ class TestHeuristcs < Test::Unit::TestCase def fixture(name) File.read(File.join(samples_path, name)) end + + # Only calling out '.h' filenames as these are the ones causing issues + def all_h_fixtures(language_name) + Dir.glob("#{samples_path}/#{language_name}/*.h") + end - def test_find_by_heuristics + def test_obj_c_by_heuristics languages = ["C++", "Objective-C"] - results = Heuristics.find_by_heuristics(fixture("Objective-C/StyleViewController.h"), languages) - assert_equal Language["Objective-C"], results.first + all_h_fixtures("Objective-C").each do |fixture| + results = Heuristics.find_by_heuristics(fixture("Objective-C/#{File.basename(fixture)}"), languages) + assert_equal Language["Objective-C"], results.first + end end def test_detect_still_works_if_nothing_matches